- Tkinter GUI Application Development Cookbook
- Alejandro Rodas de Paz
- 131字
- 2021-08-27 19:44:00
How it works...
The most basic way of instantiation of Button is using the text option to set the button label and the command option that references the function to be invoked when the button is clicked.
In out example, we also added PhotoImage via the image option, which takes precedence over the text string. The compound option serves to combine image and text in the same button, determining the position where the image is placed. It accepts the following constants as valid values: CENTER, BOTTOM, LEFT, RIGHT, and TOP.
The second row of buttons is created with a list comprehension, using the list of RELIEF values. The label of each button corresponds to the name of the constant, so you can note the difference in the appearance of each button.
推薦閱讀
- UI設(shè)計(jì)基礎(chǔ)培訓(xùn)教程
- INSTANT Mock Testing with PowerMock
- 單片機(jī)C語(yǔ)言程序設(shè)計(jì)實(shí)訓(xùn)100例:基于STC8051+Proteus仿真與實(shí)戰(zhàn)
- Learning SAP Analytics Cloud
- Mastering PHP Design Patterns
- 深入淺出PostgreSQL
- Java零基礎(chǔ)實(shí)戰(zhàn)
- Go語(yǔ)言編程
- Advanced Python Programming
- 大規(guī)模語(yǔ)言模型開(kāi)發(fā)基礎(chǔ)與實(shí)踐
- Design Patterns and Best Practices in Java
- 計(jì)算機(jī)常用算法與程序設(shè)計(jì)教程(第2版)
- 劍指大數(shù)據(jù):企業(yè)級(jí)電商數(shù)據(jù)倉(cāng)庫(kù)項(xiàng)目實(shí)戰(zhàn)(精華版)
- Python自動(dòng)化運(yùn)維:技術(shù)與最佳實(shí)踐
- Python網(wǎng)絡(luò)運(yùn)維自動(dòng)化