- Tkinter GUI Application Development Blueprints(Second Edition)
- Bhaskar Chaudhary
- 176字
- 2021-06-24 18:35:03
The Tkinter geometry manager
You may recall that we used the pack() method to add widgets to the dummy application that we developed in the previous section. The pack() method is an example of geometry management in Tkinter.
The pack() method is not the only way of managing the geometry in your interface. In fact, there are three geometry managers in Tkinter that let you specify the position of widgets inside a top-level or parent window.
The three geometry managers are as follows:
- pack: This is the one that we have used so far. It is simple to use for simpler layouts, but it may get very complex for slightly complex layouts.
- grid: This is the most commonly used geometry manager, and provides a table-like layout of management features for easy layout management.
- place: This is the least popular, but it provides the best control for the absolute positioning of widgets.
Now, let's have a look at some examples of all the three geometry managers in action.
推薦閱讀
- Python for Secret Agents:Volume II
- 深入實踐Spring Boot
- Java EE 7 Development with NetBeans 8
- Functional Kotlin
- The Complete Coding Interview Guide in Java
- Mastering Apache Maven 3
- 編程與類型系統
- 匯編語言編程基礎:基于LoongArch
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- Mastering Apache Camel
- Java Web動態網站開發(第2版·微課版)
- 詩意的邊緣
- Python程序設計教程
- Tkinter GUI Application Development Blueprints
- Spring Microservices