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

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.
主站蜘蛛池模板: 连云港市| 理塘县| 彭州市| 沈阳市| 金门县| 周宁县| 泉州市| 南通市| 商南县| 安陆市| 邹平县| 霍林郭勒市| 安徽省| 青龙| 乌海市| 永寿县| 天台县| 宾阳县| 伊金霍洛旗| 隆安县| 运城市| 吴川市| 通州区| 庆城县| 铜山县| 临高县| 论坛| 永川市| 稷山县| 绥芬河市| 随州市| 平塘县| 咸宁市| 蒙自县| 双江| 内丘县| 临城县| 台北市| 普格县| 阿瓦提县| 慈利县|