File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import tkinter as tk
22import tk_tools
33
4- root = tk .Tk ()
54
6- led = tk_tools .Led (root , size = 50 )
7- led .pack ()
5+ if __name__ == '__main__' :
86
9- tk . Button ( root , text = 'red' , command = led . to_red ). pack ( fill = tk .X )
7+ root = tk .Tk ( )
108
11- tk .Button (root ,
12- text = 'red on' ,
13- command = lambda : led .to_red (True )).pack (fill = tk .X )
9+ led = tk_tools .Led (root , size = 50 )
10+ led .pack ()
1411
15- tk .Button (root , text = 'green ' , command = led .to_green ).pack (fill = tk .X )
12+ tk .Button (root , text = 'red ' , command = led .to_red ).pack (fill = tk .X )
1613
17- tk .Button (root ,
18- text = 'green on' ,
19- command = lambda : led .to_green (True )).pack (fill = tk .X )
14+ tk .Button (root ,
15+ text = 'red on' ,
16+ command = lambda : led .to_red (True )).pack (fill = tk .X )
2017
21- tk .Button (root , text = 'yellow ' , command = led .to_yellow ).pack (fill = tk .X )
18+ tk .Button (root , text = 'green ' , command = led .to_green ).pack (fill = tk .X )
2219
23- tk .Button (root ,
24- text = 'yellow on' ,
25- command = lambda : led .to_yellow (True )).pack (fill = tk .X )
20+ tk .Button (root ,
21+ text = 'green on' ,
22+ command = lambda : led .to_green (True )).pack (fill = tk .X )
2623
27- tk .Button (root , text = 'grey ' , command = led .to_grey ).pack (fill = tk .X )
24+ tk .Button (root , text = 'yellow ' , command = led .to_yellow ).pack (fill = tk .X )
2825
29- root .mainloop ()
26+ tk .Button (root ,
27+ text = 'yellow on' ,
28+ command = lambda : led .to_yellow (True )).pack (fill = tk .X )
29+
30+ tk .Button (root , text = 'grey' , command = led .to_grey ).pack (fill = tk .X )
31+
32+ root .mainloop ()
You can’t perform that action at this time.
0 commit comments