I am using a wxNoteBook and I have a class SkullFilm derived from
wxPanel like so:
class SkullFilm(wxPanel):
def __init__(self, parent):
wxPanel.__init__(self, parent.note, -1)
...snip...
def save_coords(self):
...do something...
The wxNoteBook class adds SkullFilm' pages like so
def OnAdd(self,event):
'Adds a new skull film frame'
sf = SkullFilm(self)
self.note.AddPage(sf, sf.get_name(), 1) # can access derived class member functions
Later, after I have made some edits in the SkullFilm, I want to save
them like so
def OnSave(self,event):
'Save the current skull film frame'
page = self.note.GetSelection()
self.note.GetPage( page ).save_coords() # cannot access derived class member functions
The problem is that self.note.GetPage( page ) is returning the base
class of SkullFilm, ie a wxPanel. If I call the above function, I
get:
AttributeError: wxPanelPtr instance has no attribute 'save_coords'
It appears that the object is being cast to the base class. In idea
how I can access the derived member (SkullFilm) methods?
Thanks,
John Hunter