- 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.
推薦閱讀
- Git Version Control Cookbook
- JavaScript修煉之道
- 少年輕松趣編程:用Scratch創作自己的小游戲
- AngularJS Web Application Development Blueprints
- Xcode 7 Essentials(Second Edition)
- Android 7編程入門經典:使用Android Studio 2(第4版)
- Mastering Unity Shaders and Effects
- GeoServer Beginner's Guide(Second Edition)
- Learning OpenStack Networking(Neutron)
- Spring快速入門
- C語言程序設計
- Android開發三劍客:UML、模式與測試
- Building Serverless Architectures
- Practical Microservices
- 深入實踐DDD:以DSL驅動復雜軟件開發