wx.Panels + BoxSizer

Kris Luyten <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <1072219138.611.18.camel@kluyten>
Hi,

I was wondering whether the Sizers in wx.Net work within
Panels: I use panels as containers to group widgets (assuming panels are
suitable to do this (-: ), and each panel has its own Sizer. Still, the
following code does not show all widgets (it only show a rectangle
appearantly), although I expected the Panels to stretch according to
their contained widgets by using the Sizers:
====
Button b1,b2,b3,b4;
BoxSizer overAll = new BoxSizer(Orientation.wxVERTICAL);
BoxSizer row1 = new BoxSizer(Orientation.wxHORIZONTAL);
BoxSizer row2 = new BoxSizer(Orientation.wxHORIZONTAL);

Panel p1 = new Panel(this);
b1 = new Button(p1, -1, "Upper left");
b2 = new Button(p1, -1, "Upper right");
row1.Add(b1); row1.Add(b2);
p1.Sizer = row1;

Panel p2 = new Panel(this);
b3 = new Button(p2, -1, "Botton left");
b4 = new Button(p2, -1, "Bottom rigth");
row2.Add(b3); row2.Add(b4);
p2.Sizer = row2;

overAll.Add(p1); overAll.Add(p2);
Sizer = overAll;
====
(The full example is available
on:http://lumumba.luc.ac.be/kris/projects/uiml.net/wxtest.cs, the
screenshot here:
http://lumumba.luc.ac.be/kris/projects/uiml.net/wxtest.jpg).

Since the example works when the panels are removed, I was wondering
whether this is correct behavior, or whether I should use the Sizers as
containers? 


Thanks,
Kris
-- 
Kris Luyten
email: [email protected]
http://lumumba.luc.ac.be/kris/projects/uiml.net/




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.