[wxPython] ListCtrl behaving differently in different conditions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] ListCtrl behaving differently in different conditions

Jethro Cramp
I've been playing around with the list control learning about the different ways of controlling the layout in wxPython and I have come across the following:
 
If I make a list control and put it on a frame you can change the width of the columns and the vertical scrolling works. Also the list control re-sizes automatically as the frame is resized filling the whole frame.
 
If on the same frame I make a horizontal split and then place the list on the upper part of the split, then in order to make it fill all the space hozontally I have to use a wxBoxSizer control (OK so far). But then you can't re-size the columns nor can you use the vertical scroll. When the window is resized neither the top nor the bottom half of the split resize.
 
Why is this?
 
I'm guessing that to control the behaviour of both halves of the split I somehow need to implement a layout control that controls them both but I can't figure out what it should be.

Regards,
 
Jethro Cramp
Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] ListCtrl behaving differently in different conditions

Robin Dunn
If I make a list control and put it on a frame you can change the width of the columns and the vertical scrolling works. Also the list control re-sizes automatically as the frame is resized filling the whole frame.
 
If on the same frame I make a horizontal split and then place the list on the upper part of the split, then in order to make it fill all the space hozontally I have to use a wxBoxSizer control (OK so far). But then you can't re-size the columns nor can you use the vertical scroll. When the window is resized neither the top nor the bottom half of the split resize.
 
Why is this?
 
I'm guessing that to control the behaviour of both halves of the split I somehow need to implement a layout control that controls them both but I can't figure out what it should be.
 
The wxSplitterWindow will automatically resize their child windows to fill the available space, just like the wxFrame will do if there is only one child.  My guess is that you have some other window between the splitter and the list ctrl.  That window is being resized but it doesn't know how to automatically resize the list so that is why you need the sizer.
 
It sounds like you also have the same or a similar problem between the frame and the splitter, either there is some other window between them, or more than one of your windows specify the frame as their parent, otherwise the splitter would be resized to fill the whole frame.
 
If this is not the case please send your sources so we can take a closer look.
 
--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!