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

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.

主站蜘蛛池模板: 紫云| 金沙县| 丰城市| 丹棱县| 珲春市| 鹤庆县| 法库县| 阳春市| 齐河县| 广宗县| 大关县| 靖西县| 高碑店市| 文山县| 库伦旗| 衡南县| 黄骅市| 金溪县| 灵川县| 昆明市| 丹寨县| 青铜峡市| 松原市| 洪雅县| 封丘县| 宁阳县| 洛阳市| 宁都县| 东至县| 宁德市| 韶关市| 合江县| 鹤壁市| 林口县| 盘锦市| 内丘县| 麻栗坡县| 定西市| 柯坪县| 蕲春县| 晋江市|