The Pack geometry manager packs widgets in rows or columns. We can use options like fill, expand, and side to control this geometry manager.
Compared to the grid manager, the pack manager is somewhat limited, but it’s much easier to use in a few, but quite common situations:
- Put a widget inside a frame (or any other container widget), and have it fill the entire frame
- Place a number of widgets on top of each other
- Place a number of widgets side by side
Code #1: Putting a widget inside frame and filling entire frame. We can do this with the help of expand and fill options.
Code #2: Placing widgets on top of each other and side by side. We can do this by side option.
- Python | after method in Tkinter
- Python | geometry method in Tkinter
- maxsize() method in Tkinter | Python
- resizable() method in Tkinter | Python
- minsize() method in Tkinter | Python
- destroy() method in Tkinter | Python
- Python | place() method in Tkinter
- Python | grid() method in Tkinter
- iconphoto() method in Tkinter | Python
- Python Tkinter | grid_location() and grid_size() method
- Python | forget_pack() and forget_grid() method in Tkinter
- Python Tkinter | Moving objects using Canvas.move() method
- Python GUI - tkinter
- Python: Age Calculator using Tkinter
- Different messages in Tkinter | Python
- Python-Tkinter Scrollbar
- Python | GUI Calendar using Tkinter
- Python Tkinter Tutorial
- RadioButton in Tkinter | Python
- Python Tkinter - Message
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.