wxNotebook on a wxPanel.. how?

P

phark52

I have a wxFrame. On it is a wxNotebook, the Notebook ctrl has 5 tabs
(Each one is a wxPanel.) On one of the tab pages (panels) I want to add
another notebook ctrl. I get no errors but nothing shows up on the
panel.. why is that? If I add a button or checkbox to the sizer on that
panel, it shows. A notebook ctrl just isn't visible. The code is below:

I checked and AddPage() returns True
Weird thing is I can see a little bit, like the corner of a button
where the wxNotebook is supposed to start.

class TabPage(wxPanel):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)

self.nb = wxNotebook(self, -1)
self.nb.AddPage(wxPanel(self.nb, -1), "Settings")

sizer = wxBoxSizer(wxHORIZONTAL)
sizer.Add(self.nb(self))
self.SetSizer(sizer)
self.Layout()
self.Fit()
 
P

phark52

The above code I pasted was not correct. I pasted an older version. The
sizer.Add() line should of been sizer.Add(self.nb) -- omit the (self).

but I fixed the problem. I had to change that same line to
sizer.add(self.nb, 1, wxEXPAND|wxALL)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top