Multiple panels within a frame (sizer question)

Here it is. I went through the motions before. DOn't
know what happened.

--vicki

You didn't attach any code!

From: <vicki@stanfield.net>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, April 18, 2003 11:49 AM
Subject: [wxPython-users] Multiple panels within a
frame (sizer question)

> I am trying to get a couple of panels to show up
within
> one frame. I think I am having trouble with the

sizer

> stuff and they are writing over each other. Can
someone
> take a look at the attached code please? I am

getting

wxComTool2.py (3.49 KB)

ยทยทยท

----- Original Message -----
> better at this, and it seems drastically easier than
> Tkinter.
>
> --vicki
>
>

---------------------------------------------------------------------

> To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org
>
>

------- End of forwarded message -------

vicki@stanfield.net wrote:

> > I am trying to get a couple of panels to show up
> within
> > one frame. I think I am having trouble with the
sizer
> > stuff and they are writing over each other. Can
> someone
> > take a look at the attached code please?

you've added the panels to the frame, but not given any information
about where they should be placed. Here's one option:

        panel1 = ComboBoxPanel(self,1, size=wxDefaultSize,
style=wxSUNKEN_BORDER)
        panel2 = SecondPanel(self, 2, size=wxDefaultSize,
style=wxSUNKEN_BORDER)

        box = wxBoxSizer(wxHORIZONTAL)
        box.Add(panel1, 1, wxEXPAND)#|wxALL, 5)
        box.Add(panel2, 1, wxEXPAND)#|wxALL, 5)
        
        self.SetAutoLayout(true)
        self.SetSizer(box)
        self.Layout()

I am getting
> > better at this, and it seems drastically easier than
> > Tkinter.

The easy stuff is easier with tkInter, but the hard stuff is much
harder. Sizers take some work to wrap your brain around, but they are
very powerful and flexible once you get them working for you. Make sure
to take a good look at the demo, and whatever you can find on the Wiki.
And keep asking questions here.

You also might want to take a look at the PythonCard project and/or
wxDesigner. wxDesigner is not free, but it will save you a lot of time
laying out sizer based GUIs.

Also: Start small. What I do is make a samll test app and put just two
buttons on it untill I have the sizing figured out. then I put my real
panels or whatever in.

-Chris

-- --
Christopher Barker, Ph.D.
Oceanographer
                                                
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov