f rom wrote:
following code is illegal:
if __name__ == "__main__":
class my_dialog(wx.Dialog):
else:
class my_dialog(wx.Panel):How can I achieve this dynamic derivation in another way ?
This is Python so everything is an object, including classes, so this works just fine:
if __name__ == "__main__":
parentClass = wx.Dialog
else:
parentClass = wx.Panel
class my_dialog(parentClass):
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!