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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset