>I want to place 2 panels side by side (horizontally) on another panel, but the second panel does not show up:
>
Don't know as it does show up for me with the slightly modified code I
attach.
I tested with wxPython Phoenix 3.0.1.dev76271, but I would expect it to behave the same with at least 2.9.5+.
I suspected that it was just too small that is why I used the "WIT" (http://wiki.wxpython.org/Widget%20Inspection%20Tool), just add it to your code and press "ctrl+alt+i" and use the 'Highlight' toolbar button to see what is happening.
Sir, I used the inspection tool, when I highlight the first child panel , I see that it consumes all main window space (it has red rectangle when I press highlight button). On the other hand, when I try yo highlight second child panel, I don’t see any red rectangles, although the second child panel is listed under the inspection tree.
When I look at the sizes of panels, I see that parent panel has size (840,250), and the position of second child panel is (920,40). Is it a problem?
···
On Monday, April 14, 2014 5:15:52 PM UTC+3, werner wrote:
Hi Steve,
On 4/14/2014 15:36, steve wrote:
Hi,
I want to place 2 panels side by side (horizontally) on another panel, but the second panel does not show up:
` Don’t know as it does show up for me with the slightly
modified code I attach.
`
`<img src="https://groups.google.com/group/wxpython-users/attach/cd59ae2568988386/fceedgfg.png?part=5&authuser=0" alt="">
I tested with wxPython Phoenix 3.0.1.dev76271, but I would expect
it to behave the same with at least 2.9.5+.
I suspected that it was just too small that is why I used the
I used the inspection tool, when I highlight the first child panel , I see that it consumes all main window space (it has red rectangle when I press highlight button). On the other hand, when I try yo highlight second child panel, I don't see any red rectangles, although the second child panel is listed under the inspection tree.
That indicates that your real code does something different then the code you showed us. I replaced a custom class you had used with a wx.Panel as the custom class was not included, maybe it uses up too much space and so there isn't any for the second panel.
You might want to use e.g. a wx.Splitter to contain the two panels to give the user more control over how space is allocated.
When I look at the sizes of panels, I see that parent panel has size (840,250), and the position of second child panel is (920,40). Is it a problem?
That could be the problem, but it sounds strange to me. Are you sure the parenting is correct, i.e. does it show in the WIT as you expect it to be? Maybe do a parentpanel.Layout() after you added the second child panel.
If you still don't see it do a sample application and I or someone else here will be able to help you.
Hi Werner,
I took your suggestion and used a splitter window instead. Then I placed 1 panel on each split. Now it is OK.
However, I want to know how to do it solely with sizers as well. How would you MAKE a panel have a minimum size and adjust its position so that you make sure it is visible?
···
On Monday, April 14, 2014 7:28:26 PM UTC+3, werner wrote:
Hi Steve,
On 4/14/2014 17:40, steve wrote:
Sir,
No Sir needed, Werner will do:-)
I used the inspection tool, when I highlight the first child panel , I
see that it consumes all main window space (it has red rectangle when
I press highlight button). On the other hand, when I try yo highlight
second child panel, I don’t see any red rectangles, although the
second child panel is listed under the inspection tree.
That indicates that your real code does something different then the
code you showed us. I replaced a custom class you had used with a
wx.Panel as the custom class was not included, maybe it uses up too much
space and so there isn’t any for the second panel.
You might want to use e.g. a wx.Splitter to contain the two panels to
give the user more control over how space is allocated.
When I look at the sizes of panels, I see that parent panel has size
(840,250), and the position of second child panel is (920,40). Is it a
problem?
That could be the problem, but it sounds strange to me. Are you sure
the parenting is correct, i.e. does it show in the WIT as you expect it
to be? Maybe do a parentpanel.Layout() after you added the second child
panel.
If you still don’t see it do a sample application and I or someone else
here will be able to help you.