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

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.

主站蜘蛛池模板: 准格尔旗| 板桥市| 武平县| 寿阳县| 瓮安县| 饶平县| 寿宁县| 改则县| 洞口县| 梅河口市| 吉木萨尔县| 昭觉县| 神农架林区| 施甸县| 综艺| 土默特左旗| 治多县| 克什克腾旗| 元阳县| 濉溪县| 桓台县| 安塞县| 宁化县| 绵竹市| 龙里县| 桂平市| 大名县| 磴口县| 分宜县| 广德县| 昌乐县| 武乡县| 洛川县| 建始县| 长寿区| 合作市| 徐汇区| 张北县| 康平县| 大新县| 马鞍山市|