Hi,
I'm looking for an implementation of a "floating sizer". The use case is
this: I have a bunch of buttons which I currently have in an horizontal
wxBoxSizer. However, if there are too many buttons, some are not shown
because the width is too small. I'd like those buttons to wrap around
("line-break") and show up in a second line of buttons.
I distantly remember that something like that was discussed in
wxpython-users before (or was it in wx-dev?) and there was even a
prototypical implementation, but a thorough web and mailing list search
didn't help.
Any help greatly appreciated.
Markus
Markus Meyer wrote:
Hi,
I'm looking for an implementation of a "floating sizer". The use case is
this: I have a bunch of buttons which I currently have in an horizontal
wxBoxSizer. However, if there are too many buttons, some are not shown
because the width is too small. I'd like those buttons to wrap around
("line-break") and show up in a second line of buttons.
Isn't that the normal behaviour of a (Flex)GridSizer? You specify the number of
cols and rows and while adding items, if the end of a row is reached, the next
row is being filled.
Christian
Christian,
Christian Kristukat schrieb:
Isn't that the normal behaviour of a (Flex)GridSizer? You specify the number of
cols and rows and while adding items, if the end of a row is reached, the next
row is being filled.
Yeah, but in my case the limiting factor is not the number of columns
but the size of the individual button. Say, one button is 100 px wide,
and I have 10 buttons on a 800x600 screen. Then, 8 buttons will be shown
in the first row, and 2 in the second. When the user resizes the window
to be only 600x500 wide, 6 buttons will be shown in the first row and 4
in the second.
Markus