-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (34 loc) · 1.53 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Shah, Chirag H.
# 2019-04-30
#----------------------------------------------------------------------
# This code was originally created by Prof. Farhad Kamangar.
# Further modifications are done to code to implement and serve other functionality .
#----------------------------------------------------------------------
# The initialization of tkinter is deeply recursive. On Ubuntu, the
# limit is too low for tkinter to succeed. Trial-and-error has shown
# that 2000 seems to work. If a more complex program starts failing,
# the limit might have to be even higher.
import sys
_RECURSION_LIMIT = 2000
if ( sys.getrecursionlimit() < _RECURSION_LIMIT ) :
print( f'System recursion limit was {sys.getrecursionlimit()}, setting to {_RECURSION_LIMIT}.' )
sys.setrecursionlimit( _RECURSION_LIMIT )
#----------------------------------------------------------------------
import tkinter as tk
import myWidgets
import myGraphics
#----------------------------------------------------------------------
def onClosing() :
if tk.messagebox.askokcancel( "Really Quit?", "Do you really wish to quit?" ) :
tk.Tk().quit()
#----------------------------------------------------------------------
def main() :
ob_root_window = tk.Tk()
ob_root_window.protocol( "WM_DELETE_WINDOW", onClosing )
ob_world = myGraphics.cl_world()
myWidgets.cl_widgets( ob_root_window, ob_world )
ob_root_window.mainloop()
print( '... mainloop has exited.' )
if ( __name__ == "__main__" ) :
main()
#----------------------------------------------------------------------