Ok so I am trying to find the frame which Tkinter is using, then take its width and height and resize the window so that everything fits nicely without ugly spaces left. So far I have gotten the following...
convert = {"tab1_name", "tab1"; "tab2_name", "tab2"; "tab3_name", "tab3") ##(it goes on)
a = mainframe.tab(mainframe.select(), "text")
b = convert[a]
w = b.winfo_reqwidth()
h = b.winfo_reqheight()
mainframe.configure(width=w, height=h)
The names of each frame in the notebook are tab1, tab2, tab3, etc., but the labels on them are unique because they describe what happens in the tab. I want to be able to take the string returned from the convert dictionary function and use it as the frame's name. I am not sure if the frame is a class or what else. Is there a way to convert the string b into the frame's name and somehow use it in the .winfo_reqheight()? I do not want to have to make a thing which says...
if b=="tab1":
w = tab1.winfo_reqwidth()
h = tab1.winfo_reqheight()
mainframe.configure(width=w, height=h)
for each frame because I want it to be easy to add new frames without having to add so much code.
Thank you