wxPython, can't see a sub-class of wxPanel

Grumfish nobody at nowhere.com
Wed Feb 5 04:38:30 CET 2003


Iv'e created a frame with only a notebook on it. Each page of the
notebook is sub-class of wxPanel. The panels don't show up. The pages
of the notebook are blank. Below is some of my code. What's wrong? And
should I use a wxPanel or a wxWinodw for this sort of thing?


class MainWindow (wxFrame):
  def __init__ (self, parent, id, title):
    wxFrame.__init__ (self, parent, -4, title)

    self.create_menu()
    self.CreateStatusBar()

    self.notebook = wxNotebook (self, ID_NOTEBOOK)

    self.editor_page = EditorPage (self.notebook, ID_EDITOR_PAGE)
    self.compile_page = CompilePage (self.notebook, ID_COMPILE_PAGE)

    self.notebook.AddPage (self.editor_page, "Files")
    self.notebook.AddPage (self.compile_page, "Compile")

    self.Show (true)


class EditorPage (wxPanel):
  def __init__ (self, parent, id):
    wxPanel.__init__ (self, parent, id)

    self.splitter = wxSplitterWindow (self, ID_SPLITTER)

    self.tree = wxTreeCtrl (self.splitter, ID_DOCUMENTS)
    self.editor = wxStyledTextCtrl (self.splitter, ID_EDITOR)

    self.splitter.SplitVertically (self.tree, self.editor)
    self.splitter.SetSashPosition (400, true)




More information about the Python-list mailing list