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

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.
主站蜘蛛池模板: 甘谷县| 嘉鱼县| 许昌县| 金乡县| 莱州市| 塔城市| 衡东县| 大埔区| 平舆县| 伊金霍洛旗| 富川| 大荔县| 巴彦淖尔市| 通海县| 喀喇沁旗| 丰都县| 昌宁县| 蒙自县| 马鞍山市| 治县。| 黔西县| 江油市| 五指山市| 石河子市| 富平县| 楚雄市| 大冶市| 会东县| 阜南县| 万荣县| 开鲁县| 稷山县| 青海省| 绥中县| 苗栗县| 周至县| 平武县| 威宁| 德州市| 曲阳县| 伊川县|