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

Some important widget features

Note the following few important features that are common to all widgets:

  • All widgets are actually objects derived from their respective widget classes. So, a statement such as button = Button(its_parent) actually creates a button instance from the Button class.
  • Each widget has a set of options that decides its behavior and appearance. This includes attributes such as text labels, colors, and font size. For example, the Button widget has attributes to manage its label, control its size, change its foreground and background colors, change the size of the border, and more.
  • To set these attributes, you can set the values directly at the time of creating the widget, as demonstrated in the preceding example. Alternatively, you can later set or change the options of the widget by using the .config() or .configure() method. Note that the .config() or .configure() methods are interchangeable and provide the same functionality. In fact, the .config() method is simply an alias of the .configure() method.
主站蜘蛛池模板: 西贡区| 普格县| 江永县| 镇江市| 青龙| 咸阳市| 四平市| 始兴县| 哈巴河县| 尼木县| 襄垣县| 固始县| 思茅市| 金塔县| 大港区| 永济市| 淮北市| 兖州市| 绥棱县| 东辽县| 小金县| 湘潭县| 大埔县| 仙居县| 太保市| 八宿县| 广德县| 吉木乃县| 祁东县| 饶阳县| 宜宾县| 滨州市| 河北省| 昂仁县| 稷山县| 广东省| 江华| 满洲里市| 通渭县| 翼城县| 南通市|