Dynamic scrolled window with a static area

Hi all,

I can’t reach to create a dialog window with a dynamic scrolled area, (list of checkboxes) and a static one (2 buttons), in order that I can scroll the area of checkboxes, but with the buttons area always visible (which not part of the scrolled elements).

Is there a way to do that ?

dialog-scrollbar-dynamic-panel-static|272x500

Thanks in advance

Did you try and put your check boxes in a scrolledpanel and the two fixed buttons in another panel, then joining these two panels in a sizer?

Here is some dirty code, I can’t make it to work out, can you achieve it to work ?
test_checkbox_sizer.py (6.2 KB)

Just looking at it on the phone, I believe sizer_general should have self.scroll and self.panel as children, not the other sizers, I.e.:

sizer_general.Add(self.scroll, 1, wx.EXPAND)
sizer_general.Add(self.panel, 0, wx.EXPAND)

I haven’t looked at the proportions and expand flags but I’m sure you get the idea.

test_checkbox_sizer.py (6.2 KB)

now the dialog doesn’t shows up at all, and there is no error message…
What else am I missing do you think ?

Many thanks :slight_smile:

self.scroll.SetSizer(sizer_list)

NoNoNoNo

self.scroll.SetSizer(sizer_corp)

YesYesYesYes

I’m still on the phone so take it with a grain of salt :slight_smile:

Try the attached, seems to work for me.

test_checkbox_sizer.py (6.2 KB)

Thanks a lot Andrea :slight_smile:

But I have another question for you :
how can you get the " self.scroll " to be the largest possible, in order it can occupy all the size of the screen in the y axis (height dimension), as high as it can before it shots the scroll ?
It doesn’t maximize its height… it remains limited to few pixels.
(It is not very “dynamic”)

I tried to change with :
sizer_corp.Add(sizer_list, 1, wx.ALL|wx.EXPAND , 5)
but with no sucess …

What is your opinion ?
Sorry to bother you with my questions

test_checkbox_sizer_andrea.py (6.4 KB)