From the course: Python GUI Development with Tkinter

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Managing widget placement

Managing widget placement

From the course: Python GUI Development with Tkinter

Start my 1-month free trial

Managing widget placement

- [Instructor] As you may have noticed in the previous video, just the act of creating a Tkinter widget did not make it visible. For a widget to be displayed on screen, Tkinter needs to know exactly where to draw that widget. This is where geometry management comes into play. The Tk Geometry Manager take instructions from the program and does its best to place the widgets in their intended locations. It uses the concept of master and slave widgets to do that. When you create a new widget object, and you specify its parent, you're identifying that parent widget as the master of the child widget. That master widget will use a Geometry Manager to control the placement of its slave widget. Master widgets will typically be organizational containers like top-level windows or frames. Determining where exactly to place the slave widget is not always a simple problem. There are a lot of conditions that the Geometry Manager has to consider. For example, what should it do if the slave widgets…

Contents