Nm. I think I got it.
Is this an appropiate way of dealing with the problem I mentioned
earlier? I created my notebook instance first, and then any windows I
make refer to that instance as the parent. The class I built is going
to retain all the other functions for a notebook, right?
Also, I've seen other ways of starting the mainloop. Does it make a
difference and impact the program differently?
Stryder
···
############################################################
from wxPython.wx import *
ID_NOTEBOOK = 12
ID_TEXT_ENTRY = 15
class MainWindow(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, wxID_ANY, title,
style =
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
nb = Note(self, -1)
window = wxTextCtrl(nb, ID_NOTEBOOK, style = wxTE_MULTILINE)
nb.Add(window, "meohmy")
nb.Add(EditorPage(nb, -1), "editor")
class Note(wxNotebook):
def __init__(self, parent, id):
wxNotebook.__init__(self, parent, id, style = wxNB_TOP)
def Add(self, win, title):
self.AddPage(win, title)
class EditorPage (wxPanel):
def __init__ (self, parent, id):
wxPanel.__init__ (self, parent, id)
self.editor = wxTextCtrl (self, 3)
app = wxApp()
frame = MainWindow(None, -1, "my notebooke")
frame.Show(1)
app.MainLoop()