I am developing an application that shows some graphics in a main window. It is dialog based application. One of the widgets showing some graphics is to be hidden as default and to be shown only if a user opts to show it.
I have the application laid out and I have selected the widgets to appear in a grid layout so that they resize as the window is resized.
The problem is that when I show my hidden widget, the main application window enlarges to accommodate that widget. But when I hide that widget again, the main window does not shrink back to its original size.
I have attached an example application that shows this behavior. The application has two widgets arranged in a vertical layout. The top is a large label, the bottom widget is the graphics widget, initially hidden. Choosing to show the widget from the menu shows it, and toggling that menu hides it.
So how do I make my application window resize back to its original position after I hide widget?
Thanks.
Bookmarks