Set Window/Dialogue size to optimal values Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Set Window/Dialogue size to optimal values

Post by Elmi »

Hi,

In Java there is a feature to find the optimal size for a window/dialogue: When all GUI-elements are added to the layout (using a LayoutManager that are similar to the Sizers of wxWidgets) a method is called that sets the size of the window to the one all these GUI-elements really need.

Is there something similar available in wxWidgets?

Kind regards

Michael
mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r »

Not sure what exactly the LayoutManager does or what the "optimal size" is that you are looking for. There are a couple of options that might work for you. Check out the docs for wxSizer.

Look at
wxSizer::Fit()
wxSizer::FitInside()
wxSizer::Layout()

I think one of those might be similar to what you are looking for.

-Max
Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Post by Elmi »

mc2r wrote:wxSizer::Fit()
That's exactly what I was looking for! :-)
Post Reply