python - How can remove a widget and resize the main window? -


i have test app uses python , tkinter present number of text boxes user using grid layout manager.

to reduce clutter on screen have show/hide button removes , show several non-critical widgets:

if show_all:      # display widget     widget.grid() else :     # hide widget     widget.grid_remove() 

what next force main window resize after widgets have been modified.

any suggestions welcome.

by default main window should resize, assuming user hasn't resized window. if user has resized window, might want rethink need shrink it. if resized it, want @ size resized to.

regardless, try setting window geometry of main window (eg: root.wm_geometry("")) empty string. trigger main window re-layout children.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -