- Tkinter GUI Application Development Blueprints(Second Edition)
- Bhaskar Chaudhary
- 170字
- 2021-06-24 18:35:03
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.
推薦閱讀
- 計(jì)算思維與算法入門
- vSphere High Performance Cookbook
- JavaScript語言精髓與編程實(shí)踐(第3版)
- Python王者歸來
- Redis Essentials
- Hands-On Functional Programming with TypeScript
- Cocos2d-x學(xué)習(xí)筆記:完全掌握Lua API與游戲項(xiàng)目開發(fā) (未來書庫)
- 區(qū)塊鏈底層設(shè)計(jì)Java實(shí)戰(zhàn)
- Python極簡講義:一本書入門數(shù)據(jù)分析與機(jī)器學(xué)習(xí)
- 基于SpringBoot實(shí)現(xiàn):Java分布式中間件開發(fā)入門與實(shí)戰(zhàn)
- 軟件項(xiàng)目管理實(shí)用教程
- Mockito Essentials
- Mastering Elixir
- Learning C++ by Creating Games with UE4
- Web前端測試與集成:Jasmine/Selenium/Protractor/Jenkins的最佳實(shí)踐