Can someone explain to me the difference between these two XRC examples.
The first one is a simple sizer on a panel, with a control that has
option=1 (growable control; expands in the direction of the sizer).
This works correctly.
Example two adds only one thing: another sizer containing the sizer. In
this example, nothing expands.
I can do this using the wxPython sizers API directly, but I can't figure
out why it doesn't work in XRC.
Finally, at the bottom is a little stub code to run both.
--- show_brokage.xrc ---
<?xml version="1.0" ?>
<resource>
<object class="wxFrame" name="WORKS">
<title></title>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxButton" name="showbroken">
<label>This button expands</label>
</object>
<option>1</option>
</object>
</object>
</object>
<object class="wxFrame" name="BROKEN">
<title></title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxButton" name="showworks">
<label>This button doesn't expand - why?</label>
</object>
<option>1</option>
</object>
</object>
</object>
</object>
</object>
</resource>
--- show_brokage.py ---
from wxPython.wx import *
from wxPython.xrc import *
app=wxPySimpleApp()
res=wxXmlResource('show_brokage.xrc')
res.LoadFrame(None, 'WORKS').Show(1)
res.LoadFrame(None, 'BROKEN').Show(1)
app.MainLoop()
···
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com