- Tkinter GUI Application Development Cookbook
- Alejandro Rodas de Paz
- 112字
- 2021-08-27 19:44:10
There's more…
Another important advantage of the Place geometry manager is that it may be used in conjunction with Pack or Grid.
For instance, imagine that you want to dynamically display a caption over a widget when you right-click on it. You can represent this caption with a Label widget, which gets placed in the relative position where you clicked on the widget:
def show_caption(self, event):
caption = tk.Label(self, ...)
caption.place(in_=event.widget, x=event.x, y=event.y)
# ...
As general advice, we recommend that you use any of the other geometry managers as much as possible in your Tkinter applications and leave this only for those specialized cases where you need a custom positioning.
推薦閱讀
- 多媒體CAI課件設(shè)計(jì)與制作導(dǎo)論(第二版)
- Instant Testing with CasperJS
- Learning C# by Developing Games with Unity 2020
- Android項(xiàng)目開發(fā)入門教程
- Building a RESTful Web Service with Spring
- Responsive Web Design with HTML5 and CSS3
- Learning ArcGIS for Desktop
- Python深度學(xué)習(xí)原理、算法與案例
- R語(yǔ)言數(shù)據(jù)可視化:科技圖表繪制
- Visual C++程序設(shè)計(jì)與項(xiàng)目實(shí)踐
- Android嵌入式系統(tǒng)程序開發(fā)(基于Cortex-A8)
- Professional JavaScript
- Java語(yǔ)言程序設(shè)計(jì)實(shí)用教程(第2版)
- JavaScript Mobile Application Development
- C語(yǔ)言程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)與習(xí)題精解