Unable to handle window resizing event correctly. In this program, widgets should be customized to fit the window size. topFrame should take the width across the width of the window, and the leftFrame and rightFrame should take half the width of the window and the height equal to the height of the window — the height of the topFrame. Moreover, if I change the window width, i.e. I pull the left or right edge of the window, then the widgets "react" and change the width, but if I try to do the same with height, they show a fig.

Python 2.7, Windows 7 Code here (pastebin)

    1 answer 1

    Replace two lines:

    #app = Application() app = Application(root) 

    and

     #app.bind('<Configure>',resizeFrames) root.bind('<Configure>',resizeFrames) 

    a second replacement is enough for work, but since you're using

     def __init__(self, master=root): 

    better pass this root.

    And yet, my default was opened with a minimum width, I don’t know how you are thinking, so I’ll just say this =)

    • Yes, the width is small, I tried to transfer root, but the result is the same. And I also noticed that if you stretch the window upwards, beyond the top edge, then the event is processed - LukavskyM
    • so the replacement did not help? - spirit
    • Everything, with both replacements, everything works fine! Thank you! I can not plus for turnip low :( - LukavskyM
    • Nothing, I think we'll meet again)) - spirit