I have a GUI in Tkinter that is becoming more complicated. I would like to separate it into some modules to make it easier to manage. Is there a way to separate my GUI into modules if I didn't use the object oriented approach?
Here is a simple example of some code I would like to move to a separate module:
def create_main_nav_buttons(strat_folder_list):
global dynamic_info_nav_items
temp_count = 0
for item in strat_folder_list:
main_nav = tk.Canvas(Nav_Frame_Top, width=175, height=grid_box_size/1.5, highlightthickness=1, bg='slategray1')
main_nav.grid(row = temp_count, column = 1)
main_nav.bind("<Button-1>", lambda event, x=item: create_navigation2(x))
temp_count += 1
dynamic_info_nav_items.append(main_nav)
-Side note:
I wrote a GUI using the object oriented approach before but decided to not use it this time because I didn't fully understand parts of it such as:
def __init__(self, parent, *args, **kwargs):
tk.Frame.__init__(self, parent, *args, **kwargs)
self.parent = parent
So when something went wrong it was a nightmare to fix and I couldn't find much support.