官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 宜州市| 剑阁县| 潼南县| 襄樊市| 麦盖提县| 平南县| 龙山县| 启东市| 辽中县| 和平区| 乌兰察布市| 靖西县| 永春县| 新营市| 徐州市| 柳州市| 汽车| 晋中市| 虎林市| 犍为县| 塔河县| 石棉县| 防城港市| 格尔木市| 连江县| 张家口市| 望江县| 德州市| 达孜县| 涿州市| 沁水县| 大同市| 祁门县| 开化县| 敦化市| 广平县| 平定县| 南岸区| 台湾省| 汶上县| 龙州县|