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

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.
主站蜘蛛池模板: 临颍县| 茶陵县| 东明县| 杭锦后旗| 荆州市| 淳安县| 丰顺县| 哈巴河县| 南投县| 鄂州市| 临海市| 辰溪县| 乌什县| 乾安县| 台州市| 明星| 海阳市| 三台县| 巩义市| 勃利县| 扶沟县| 桂平市| 兴业县| 吉首市| 九龙县| 黑山县| 砚山县| 中山市| 逊克县| 商都县| 蒲城县| 安国市| 湘潭市| 锡林郭勒盟| 高阳县| 灵寿县| 平顺县| 亳州市| 广元市| 伊金霍洛旗| 崇州市|