Update hanoi.py - add window title, and start on top with focus
This commit is contained in:
parent
f974ac14df
commit
166c45faff
3
hanoi.py
3
hanoi.py
@ -18,6 +18,7 @@ gbl_pegs = []
|
|||||||
gbl_pegstate = [[], [], []]
|
gbl_pegstate = [[], [], []]
|
||||||
gbl_disks = []
|
gbl_disks = []
|
||||||
gbl_tkroot = tk.Tk()
|
gbl_tkroot = tk.Tk()
|
||||||
|
gbl_tkroot.title('Hanoi Tower')
|
||||||
gbl_canvas = None
|
gbl_canvas = None
|
||||||
gbl_ready = True
|
gbl_ready = True
|
||||||
|
|
||||||
@ -68,6 +69,8 @@ def setup_gui():
|
|||||||
gbl_canvas = tk.Canvas(gbl_tkroot, width=CANVAS_W, height=CANVAS_H)
|
gbl_canvas = tk.Canvas(gbl_tkroot, width=CANVAS_W, height=CANVAS_H)
|
||||||
gbl_canvas.pack()
|
gbl_canvas.pack()
|
||||||
btn_start.focus_set()
|
btn_start.focus_set()
|
||||||
|
gbl_tkroot.lift()
|
||||||
|
gbl_tkroot.focus_force()
|
||||||
|
|
||||||
def change_speed(*args):
|
def change_speed(*args):
|
||||||
global gbl_speed, gbl_step
|
global gbl_speed, gbl_step
|
||||||
|
Loading…
x
Reference in New Issue
Block a user