@@ -49,6 +49,7 @@ def create_path():
4949 current_state = None
5050 start_button .config (state = DISABLED )
5151 custom_button .config (state = DISABLED )
52+ information .config (text = "click on the start button to create a path between 2 random positions" )
5253 refresh_map ()
5354
5455 if not start and not end :
@@ -93,15 +94,18 @@ def custom(state):
9394 if state == STATE_OBSTACLE :
9495 start_button .config (state = DISABLED )
9596 current_state = STATE_OBSTACLE
97+ information .config (text = "click on the grid to set/remove obstacles" )
9698 custom_button .config (text = "set the start" , command = lambda :custom (STATE_START ))
9799 refresh_map ()
98100
99101 elif state == STATE_START :
100102 current_state = STATE_START
103+ information .config (text = "click on the grid to place the start position" )
101104 custom_button .config (text = "set the end" , command = lambda :custom (STATE_END ))
102105
103106 elif state == STATE_END :
104107 current_state = STATE_END
108+ information .config (text = "click on the grid to place the end position" )
105109 custom_button .config (text = "set the obstacles" , command = lambda :custom (STATE_OBSTACLE ))
106110
107111
@@ -142,11 +146,18 @@ def get_random_positions():
142146
143147root = Tk ()
144148
149+ information_frame = LabelFrame (root , text = "Information" , width = SIZE * CELL_SIZE , height = 50 )
150+ information_frame .propagate (False )
151+ information_frame .grid (row = 0 , column = 0 )
152+
145153grid_frame = Frame (root )
146- grid_frame .grid (row = 0 , column = 0 )
154+ grid_frame .grid (row = 1 , column = 0 )
147155
148156button_frame = Frame (root )
149- button_frame .grid (row = 1 , column = 0 )
157+ button_frame .grid (row = 2 , column = 0 )
158+
159+ information = Label (information_frame , text = "click on the start button to create a path between 2 random positions" )
160+ information .pack (expand = True , fill = BOTH )
150161
151162grid = Canvas (grid_frame , width = SIZE * CELL_SIZE , height = SIZE * CELL_SIZE , bg = 'white' )
152163grid .bind ("<Button-1>" , click )
0 commit comments