Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Виджет CheckButton (флажок)
- def selectAll():
- for check in [switch1, switch2, switch3]:
- check.select()
- def deselectAll():
- for check in [switch1, switch2, switch3]:
- check.deselect()
- def toggleAll():
- for check in [switch1, switch2, switch3]:
- check.toggle()
- import tkinter as tk
- win = tk.Tk()
- win.title('Мое графическое приложение')
- win.geometry('600x300+600+350')
- switch1 = tk.Checkbutton(win, text = 'Включить микрофон')
- switch1.pack()
- switch2 = tk.Checkbutton(win, text = 'Отключить рекламу')
- switch2.pack()
- switch3 = tk.Checkbutton(win, text = 'Подписаться на канал', indicatoron = 0)
- switch3.pack()
- tk.Button(win, text = 'Выбрать всё', command = selectAll).pack()
- tk.Button(win, text = 'Отменить всё', command = deselectAll).pack()
- tk.Button(win, text = 'Переключатель', command = toggleAll).pack()
- win.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement