notebook

i'm jus tplaying around and i've hit a snag doing something very simple wrong.
would i be close in guessing wx.Panel(self, -1) is whats wrong, because "sefl" in a notebook object and it needs a window, and i can fix it somehow by using/inherititing the wx.Frame class?

import wx
   class ProjectNoteBook(wx.Notebook):
        """This class creates the text space and orangises the files into tabbed notebook style"""
        def __init__(self, parent,id):
                       #This creates the inital blank tab
            tab = self.MakePanel()
            self.AddPage(tab, "New")
               def MakePanel(self):
            """This function makes new panels"""
            p = wx.Panel(self, -1) return p
           class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size = (1024,768))
           notebook = ProjectNoteBook(self, -1)

File "PythonKISS/PythonKISS.py", line 19, in MakePanel
    p = wx.Panel(self, -1)
  File "/usr/local/lib/python2.3/site-packages/wxPython/windows.py", line 690, in __init__
    self.this = windowsc.new_wxPanel(*_args,**_kwargs)
TypeError: Type error in argument 1 of new_wxPanel. Expected _wxWindow_p.

i'm jus tplaying around and i've hit a snag doing something very simple
wrong.
would i be close in guessing wx.Panel(self, -1) is whats wrong, because
"sefl" in a notebook object and it needs a window, and i can fix it
somehow by using/inherititing the wx.Frame class?

(...)
class ProjectNoteBook(wx.Notebook):
        """This class creates the text space and orangises the files
into tabbed notebook style"""
        def __init__(self, parent,id):
              wx.Notebook.__init__(self, parent, id) # You need this Line
(...)

Ricardo

Timothy Smith wrote:

   p = wx.Panel(self, -1)
File "/usr/local/lib/python2.3/site-packages/wxPython/windows.py", line 690, in __init__
   self.this = windowsc.new_wxPanel(*_args,**_kwargs)
TypeError: Type error in argument 1 of new_wxPanel. Expected _wxWindow_p.

self isn't a full wx.Window yet because you havn't called wx.Notebook.__init__ yet.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!