FAQ
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()

Search Discussions

  • Phark52 at Mar 15, 2005 at 12:41 am
    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)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 15, '05 at 12:16a
activeMar 15, '05 at 12:41a
posts2
users1
websitepython.org

1 user in discussion

Phark52: 2 posts

People

Translate

site design / logo © 2022 Grokbase