hello,
I have a question which no documentation has answered as of now.
I have an MDI application with a class called MainWindow. MainWindow
inherits the MDI Parent and I have a set of modules which contain
classes which inherit the child frame.
now on the MainWindow I have menus to call these child windows and show them.
all the documentation I have seen so far gives an example of
dynamically creating child window classes on the spot when a button is
clicked.
but that's not the way real applications are made.
I want to create instences of my child window inherited classes and
make my MainWindow the parent of those instences.
Please give a rough idea of how I can achieve this?
It is highly possible that I am missing some thing very simple in my
idea or may be forgeting some thing very basic. but I am really
confused. for example if I have a class which inherits the child
frame I need to pass it a parent frame, so while defining the class
what should I pass in as a parent? secondly when I create the
instence of that class what should be passed?
thanks.
Krishnakant.
As per the MDI demo:
MAIN_FRAME = wx.MDIParentFrame(...)
class childMDI(wx.MDIChildFrame):
def __init__(self, parent, ...):
wx.MDIChildFrame.__init__(self, parent, ...)
#do whatever you normally do to define window content
#create a panel, set sizers, etc.
When you need to create a new childMDI window:
x = childMDI(MAIN_FRAME)
- Josiah
ยทยทยท
"krishnakant Mane" <researchbase@gmail.com> wrote:
hello,
I have a question which no documentation has answered as of now.
I have an MDI application with a class called MainWindow. MainWindow
inherits the MDI Parent and I have a set of modules which contain
classes which inherit the child frame.
now on the MainWindow I have menus to call these child windows and show them.
all the documentation I have seen so far gives an example of
dynamically creating child window classes on the spot when a button is
clicked.
but that's not the way real applications are made.
I want to create instences of my child window inherited classes and
make my MainWindow the parent of those instences.
Please give a rough idea of how I can achieve this?
It is highly possible that I am missing some thing very simple in my
idea or may be forgeting some thing very basic. but I am really
confused. for example if I have a class which inherits the child
frame I need to pass it a parent frame, so while defining the class
what should I pass in as a parent? secondly when I create the
instence of that class what should be passed?
thanks.