- Tkinter GUI Application Development Cookbook
- Alejandro Rodas de Paz
- 75字
- 2021-08-27 19:44:04
There's more...
With Checkbuttons, it is also possible to use other variable types:
var = tk.StringVar() var.set("OFF") checkbutton_active = tk.Checkbutton(master, text="Active?", variable=self.var, onvalue="ON", offvalue="OFF", command=update_value)
The only restriction is to match onvalue and offvalue with the type of the Tkinter variable; in this case, since "ON" and "OFF" are strings, the variable should be a StringVar. Otherwise, the Tcl interpreter will raise an error when trying to set the corresponding value of a different type.
推薦閱讀
- Learning LibGDX Game Development(Second Edition)
- DBA攻堅指南:左手Oracle,右手MySQL
- 程序員數學:用Python學透線性代數和微積分
- Internet of Things with Intel Galileo
- Instant QlikView 11 Application Development
- Visual Basic程序設計
- 用戶體驗可視化指南
- Learning Apache Cassandra
- ABAQUS6.14中文版有限元分析與實例詳解
- Software Development on the SAP HANA Platform
- Java從入門到精通(視頻實戰版)
- Mastering Machine Learning with R
- Learning Puppet
- JavaScript程序設計實例教程(第2版)
- 威脅建模:設計和交付更安全的軟件