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

There's more…

The sticky option indicates the borders where the widget should stick, expressed in cardinal directions: north, south, west and east. These values are represented by the Tkinter constants tk.N, tk.S, tk.W, and tk.E, as well as the combined versions tk.NW, tk.NE, tk.SW, and tk.SE.

For example, sticky=tk.N aligns the widget to the top border of the cell (north), whereas sticky=tk.SE positions the widget in the bottom-right corner of the cell (south-east).

Since these constants represent their corresponding lowercase letters, we shorthanded the tk.N + tk.S + tk.W + tk.E expression with the "nswe" string. This means that the widget should expand both horizontally and vertically—similar to the fill=tk.BOTH option of the Pack geometry manager.

If no value is passed to the sticky option, the widget is centered within the cell.

主站蜘蛛池模板: 浦江县| 临安市| 灯塔市| 新沂市| 宁城县| 德昌县| 永仁县| 英吉沙县| 出国| 攀枝花市| 宣城市| 五大连池市| 阿拉善左旗| 平陆县| 柯坪县| 沾益县| 洛宁县| 长丰县| 奇台县| 河源市| 香格里拉县| 钟山县| 昌江| 东兴市| 观塘区| 六安市| 西峡县| 重庆市| 同心县| 永定县| 麟游县| 崇义县| 开平市| 边坝县| 大理市| 临安市| 通化县| 湖州市| 通辽市| 赤峰市| 墨江|