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

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.

主站蜘蛛池模板: 德钦县| 九江县| 和田市| 罗甸县| 湛江市| 贵溪市| 子洲县| 勐海县| 南城县| 通化县| 兰州市| 筠连县| 博爱县| 华宁县| 高阳县| 镇康县| 兰坪| 土默特左旗| 石河子市| 青龙| 克东县| 桐庐县| 珲春市| 南充市| 扶风县| 容城县| 资讯 | 镇平县| 沁源县| 彰武县| 县级市| 崇州市| 察隅县| 那坡县| 桂林市| 荆门市| 新邵县| 榆林市| 赫章县| 崇州市| 金坛市|