maybe someone can already hint me in the right direction
from the attached screenshots.
I've got a panel which contains (among other things) two
grids atop each other inside a vertical sizer. This sizer is
set to proportion=1 inside the (also vertical) parent sizer
such as to eat up all the space left over by other widgets
(those being propertion=0) inside the parent sizer. The top
grid is set to proportion=1 and the bottom grid is
proportion=2 inside their sizer.
The result can be seen in screenshot 2.
While this is acceptable I would like to see the top grid
occupying as much space as is needed to display all grid
rows and the bottom grid occupying "the rest" of the
available space.
This sounds like setting the top grid to proportion=0 and
the bottom grid to proportion=1 inside their sizer. This,
however, results in the top grid being of height=1pixel as
can be seen in screenshot 4 (where the pointer is at). Most
likely this results from MinSize being (1,1) as can be seen
in the screenshot of the inspector.
Correct. If the minsize is set it will override any best size calculations that the grid is doing for itself when the sizer calculates the layout. What happens if you don't set the grid's minsize?
···
On 11/12/12 10:53 AM, Karsten Hilbert wrote:
This sounds like setting the top grid to proportion=0 and
the bottom grid to proportion=1 inside their sizer. This,
however, results in the top grid being of height=1pixel as
can be seen in screenshot 4 (where the pointer is at). Most
likely this results from MinSize being (1,1) as can be seen
in the screenshot of the inspector.
On Mon, Nov 12, 2012 at 12:49:39PM -0800, Robin Dunn wrote:
On 11/12/12 10:53 AM, Karsten Hilbert wrote:
This sounds like setting the top grid to proportion=0 and
the bottom grid to proportion=1 inside their sizer. This,
however, results in the top grid being of height=1pixel as
can be seen in screenshot 4 (where the pointer is at). Most
likely this results from MinSize being (1,1) as can be seen
in the screenshot of the inspector.
Correct. If the minsize is set it will override any best size
calculations that the grid is doing for itself when the sizer
calculates the layout. What happens if you don't set the grid's
minsize?
More likely it is because grids typically contain more columns or rows than can comfortably fit within another window, and so the default best size calculation will try to make them too big. The min size overrides that best size calc. You can call their SetMinSize method passing wx.DefaultSize to reset that, or you can specify some size other than (1,1) if you want them to have a more reasonable fixed minsize.
···
On 11/12/12 1:20 PM, Karsten Hilbert wrote:
It seems the initial size is set to (1, 1) by wxGlade -
which is sensible as the grids are empty at that time.
On Tue, Nov 13, 2012 at 10:26:01AM -0800, Robin Dunn wrote:
>It seems the initial size is set to (1, 1) by wxGlade -
>which is sensible as the grids are empty at that time.
More likely it is because grids typically contain more columns or
rows than can comfortably fit within another window, and so the
default best size calculation will try to make them too big. The min
size overrides that best size calc. You can call their SetMinSize
method passing wx.DefaultSize to reset that,