Skip to content

Commit cdd34a2

Browse files
add if __name__ == '__main__':, renamed one variable, and one function
1 parent cba6e9f commit cdd34a2

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

examples/user_calendar.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import tkinter
22
import tk_tools
33

4-
root = tkinter.Tk()
5-
root.title('TK Tools Calendar')
6-
cal = tk_tools.Calendar(root)
7-
cal.pack()
84

5+
def callback():
6+
print(calendar.selection)
97

10-
def custom_callback():
11-
print(cal.selection)
128

9+
if __name__ == '__main__':
1310

14-
cal.add_callback(custom_callback)
11+
root = tkinter.Tk()
12+
root.title('TK Tools Calendar')
13+
calendar = tk_tools.Calendar(root)
14+
calendar.pack()
1515

16-
root.mainloop()
16+
calendar.add_callback(callback)
17+
18+
root.mainloop()

0 commit comments

Comments
 (0)