By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

wxNotebook on a wxPanel.. how?

P: n/a
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()

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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)

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.