Added MDI support to Pythoncard (was MDI - childwindows within a window)
Mark Carter <[email protected]> Fri, 1 Apr 2011 12:13:02 -0400
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <[email protected]> |
--===============0434846936638293117== Content-Type: multipart/alternative; boundary=bcaec543192c7096c3049fddb0f3 --bcaec543192c7096c3049fddb0f3 Content-Type: text/plain; charset=ISO-8859-1 Hi John. Awesome! Good to know someone is still developing PythonCard! PythonCard is really a super project, for infrequent programmers like myself looking for a Visual Basic-like development experience on Python, PythonCard does the job. I don't suppose you could shepherd through a new release? The current release is several years old IIRC, and the installer has issues (either with Vista and/or latest Python, can't recall). Most people who research PythonCard these days just assume it's a dead project. Mark On Fri, Apr 1, 2011 at 10:53 AM, John Henry <[email protected]> wrote: > I am happy to report that I've succeeded in Pythoncardize > the wx.SashLayoutWindow control of wxPython > using similar technique to the MDI support I reported previously. Not > sure if > the screen capture attachment to this email will get stripped or not. If > you > don't see the screen shot, shout and I'll try to upload that somewhere. > > ########## mod to model.py ####################### > class Background(BackgroundBase, wx.Frame): > def __init__(self, aParent, aBgRsrc, init=None): > return BackgroundBase.__init__(self, aParent, aBgRsrc, > frameclass=wx.Frame, init=init) > > class MDIChildBackground(BackgroundBase, wx.MDIChildFrame): > def __init__(self, aParent, aBgRsrc, init=None): > return BackgroundBase.__init__(self, aParent, aBgRsrc, > frameclass=wx.MDIChildFrame, init=init) > > class MDIParentBackground(BackgroundBase, wx.MDIParentFrame): > def __init__(self, aParent, aBgRsrc, init=None): > return BackgroundBase.__init__(self, aParent, aBgRsrc, > frameclass=wx.MDIParentFrame, init=init) > > class SashWindow(BackgroundBase, wx.SashLayoutWindow): > def __init__(self, aParent, aBgRsrc, init=None): > rsrc = resource.Resource(aBgRsrc).application.backgrounds[0] > return BackgroundBase.__init__(self, aParent, rsrc, > frameclass=wx.SashLayoutWindow, init=init) > # Dummy routine > def SetMenuBar(self, child): > return > # Dummy routine > def GetStatusBar(self): > return > ########## end of mod to model.py #######################-- > John Henry > > > > ----- Original Message ---- > > From: John Henry <[email protected]> > > To: [email protected] > > Sent: Wed, March 9, 2011 10:08:39 AM > > Subject: Added MDI support to Pythoncard (was MDI - childwindows within a > >window) > > > > I am happy to let you know that I succeeded in adding MDI support to > Pythoncard > > > > with only a few lines of modifications to the Background class in > model.py > > > > I made the Background class into a BackgroundBase class, and have the > >Background > > > > class subclass from the BackgroundBase class. > > > > Then I added a MDIParentBackground and MDIChildBackground which simply > force > > Background to subclass from wxMDIParentFrame and wxMDIChildFrame > respectively, > > > > instead of the wx.Frame class. Once I've done that, wxPython does the > rest > >of > > > > the work. > > > > ################ mod to model.py ###################### > > > > from wxPython.wx import wxMDIParentFrame, wxMDIChildFrame > > > > # Used to say: > > # class BackgroundBase(Scriptable, wx.Frame, event.EventSource): > > class BackgroundBase(Scriptable, event.EventSource): > > """ > > A window that contains Widgets. > > """ > > def __init__(self, aParent, aBgRsrc, frameclass=wx.Frame): > > ...<original code>... > > #Changed original code from invoking wx.Frame here to a method passed > down > > # First, call the base class' __init__ method to create the > frame > > frameclass.__init__(self, aParent, > > self.id, > > #self.name, > > aBgRsrc.title, > > position, > > aBgRsrc.size, > > style | wx.NO_FULL_REPAINT_ON_RESIZE, > > aBgRsrc.name) > > ...<rest of original code>... > > > > > > class Background(BackgroundBase, wx.Frame): > > def __init__(self, aParent, aBgRsrc): > > return BackgroundBase.__init__(self, aParent, aBgRsrc, > > frameclass=wx.Frame) > > > > class MDIParentBackground(BackgroundBase, wxMDIParentFrame): > > def __init__(self, aParent, aBgRsrc): > > return BackgroundBase.__init__(self, aParent, aBgRsrc, > > frameclass=wxMDIParentFrame) > > > > class MDIChildBackground(BackgroundBase, wxMDIChildFrame): > > def __init__(self, aParent, aBgRsrc): > > return BackgroundBase.__init__(self, aParent, aBgRsrc, > > frameclass=wxMDIChildFrame) > > > > ############## end of mod to model.py ######################### > > > > To use these two new classes, the code is remarkably unremarkable. The > parent > > > > code: > > > > ############# Parent ###################### > > #!/usr/bin/python > > > > """ > > __version__ = "$Revision: 1.5 $" > > __date__ = "$Date: 2004/04/30 16:26:12 $" > > """ > > > > from PythonCard import model > > > > MDI_rsrc=\ > > {'application':{'type':'Application', > > 'name':'Template', > > 'backgrounds': [ > > {'type':'Background', > > 'name':'bgTemplate', > > 'title':'Testing MDI Controls', > > 'size':(400, 300), > > 'style':['resizeable'], > > > > 'menubar': {'type':'MenuBar', > > 'menus': [ > > {'type':'Menu', > > 'name':'menuFile', > > 'label':'&File', > > 'items': [ > > {'type':'MenuItem', > > 'name':'menuFileExit', > > 'label':'E&xit', > > 'command':'exit', > > }, > > ] > > }, > > {'type':'Menu', > > 'name':'menuOptions', > > 'label':'Options', > > 'items': [ > > {'type':'MenuItem', > > 'name':'menuOptionsOpenNew', > > 'label':'Open New\tAlt+N', > > 'command':'openNew', > > }, > > ] > > }, > > ] > > }, > > 'components': [ > > > > ] # end components > > } # end background > > ] # end backgrounds > > } } > > > > MyCW_rsrc=\ > > {'application':{'type':'Application', > > 'name':'Template', > > 'backgrounds': [ > > {'type':'Background', > > 'name':'bgTemplate', > > 'title':'Standard Template with File->Exit menu', > > 'size':(698, 517), > > 'style':['resizeable'], > > > > 'menubar': {'type':'MenuBar', > > 'menus': [ > > {'type':'Menu', > > 'name':'menuFile', > > 'label':'&File', > > 'items': [ > > {'type':'MenuItem', > > 'name':'menuFileExit', > > 'label':'E&xit', > > 'command':'exit', > > }, > > ] > > }, > > {'type':'Menu', > > 'name':'menuOptions', > > 'label':'Options', > > 'items': [ > > {'type':'MenuItem', > > 'name':'menuOptionsOpenNew', > > 'label':'Open New\tAlt+N', > > 'command':'openNew', > > }, > > ] > > }, > > ] > > }, > > 'components': [ > > > > {'type':'TextArea', > > 'name':'TextArea1', > > 'position':(20, 20), > > 'size':(651, 333), > > }, > > > > {'type':'Button', > > 'name':'Button1', > > 'position':(559, 376), > > 'label':'Button1', > > }, > > > > ] # end components > > } # end background > > ] # end backgrounds > > } } > > > > class MyBackground(model.MDIParentBackground): > > > > def on_initialize(self, event): > > # if you have any initialization > > # including sizer setup, do it here > > #MDI.on_initialize(self, event) > > pass > > def on_openNew_command ( self, event ): > > # Create a child window > > child = model.childWindow(self, MyCW, rsrc=MyCW_rsrc) > > > > if __name__ == '__main__': > > app = model.Application(MyBackground, None, MDI_rsrc) > > app.MainLoop() > > ############# End of Parent ###################### > > > > ############# Child ###################### > > class MyCW(model.MDIChildBackground): > > > > def on_initialize(self, event): > > self.parent = self.getParent() > > self.components.TextArea1.text='I am only a child.' > > def on_openNew_command ( self, event ): > > return self.parent.on_openNew_command ( event ) > > ############# End of Child ###################### > > > > That's it!!! > > > > Now I have to play around with resizer to see how that would work here. > > > > -- > > John Henry > > > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > > _______________________________________________ > Pythoncard-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > -- Mark Carter, OCT markcarter.tel -- Mark Carter, OCT markcarter.tel --bcaec543192c7096c3049fddb0f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">Hi John.<br><br>Awesome!=A0 Good to know someone= is still developing PythonCard!=A0 PythonCard is really a super project, f= or infrequent programmers like myself looking for a Visual Basic-like devel= opment experience on Python, PythonCard does the job.<br> <br>I don't suppose you could shepherd through a new release?=A0 The cu= rrent release is several years old IIRC, and the installer has issues (eith= er with Vista and/or latest Python, can't recall).=A0 Most people who r= esearch PythonCard these days just assume it's a dead project.<br> <br>Mark<br><br><br><div class=3D"gmail_quote"><div><div></div><div class= =3D"h5">On Fri, Apr 1, 2011 at 10:53 AM, John Henry <span dir=3D"ltr"><<= a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>= ></span> wrote:<br> </div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo= rder-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class=3D"h5= "> I am happy to report that I've succeeded in Pythoncardize<br> the wx.SashLayoutWindow control of wxPython<br> =A0using similar technique to the MDI support I reported previously. =A0 No= t sure if<br> the screen capture attachment to this email will get stripped or not. =A0If= you<br> don't see the screen shot, shout and I'll try to upload that somewh= ere.<br> <br> ########## mod to model.py #######################<br> class Background(BackgroundBase, wx.Frame):<br> =A0 =A0def __init__(self, aParent, aBgRsrc, init=3DNone):<br> =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, aBgRsrc,<br> frameclass=3Dwx.Frame, init=3Dinit)<br> <br> class MDIChildBackground(BackgroundBase, wx.MDIChildFrame):<br> =A0 =A0def __init__(self, aParent, aBgRsrc, init=3DNone):<br> =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, aBgRsrc,<br> frameclass=3Dwx.MDIChildFrame, init=3Dinit)<br> <br> class MDIParentBackground(BackgroundBase, wx.MDIParentFrame):<br> =A0 =A0def __init__(self, aParent, aBgRsrc, init=3DNone):<br> =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, aBgRsrc,<br> frameclass=3Dwx.MDIParentFrame, init=3Dinit)<br> <br> class SashWindow(BackgroundBase, wx.SashLayoutWindow):<br> =A0 =A0def __init__(self, aParent, aBgRsrc, init=3DNone):<br> =A0 =A0 =A0 =A0rsrc =3D resource.Resource(aBgRsrc).application.backgrounds= [0]<br> =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, rsrc,<br> frameclass=3Dwx.SashLayoutWindow, init=3Dinit)<br> =A0# Dummy routine<br> =A0 =A0def SetMenuBar(self, child):<br> =A0 =A0 =A0 =A0return<br> =A0 =A0# Dummy routine<br> =A0 =A0def GetStatusBar(self):<br> =A0 =A0 =A0 =A0return<br> ########## end of mod to model.py #######################--<br> John Henry<br> <br> <br> <br> ----- Original Message ----<br> > From: John Henry <<a href=3D"mailto:[email protected]" target=3D"_b= lank">[email protected]</a>><br> > To: <a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a><br> > Sent: Wed, March 9, 2011 10:08:39 AM<br> > Subject: Added MDI support to Pythoncard (was MDI - childwindows withi= n a<br> >window)<br> ><br> > I am happy to let you know that I succeeded in adding MDI support to P= ythoncard<br> ><br> > with only a few lines of modifications to the Background class in mode= l.py<br> ><br> > I made the Background =A0class into a BackgroundBase class, and have t= he<br> >Background<br> ><br> > class subclass =A0from the BackgroundBase class.<br> ><br> > Then I added a MDIParentBackground =A0and MDIChildBackground which sim= ply force<br> > Background to subclass from =A0wxMDIParentFrame and wxMDIChildFrame re= spectively,<br> ><br> > instead of the wx.Frame =A0class. =A0 Once I've done that, wxPytho= n does the rest<br> >of<br> ><br> > the =A0work.<br> ><br> > ################ mod to model.py ######################<br> ><br> > from =A0wxPython.wx import wxMDIParentFrame, wxMDIChildFrame<br> ><br> > # Used to say:<br> > # =A0class BackgroundBase(Scriptable, wx.Frame, =A0event.EventSource):= <br> > class =A0BackgroundBase(Scriptable, event.EventSource):<br> > =A0 =A0 """<br> > =A0 =A0 =A0A window that contains Widgets.<br> > =A0 =A0 """<br> > =A0 =A0 def =A0__init__(self, aParent, aBgRsrc, frameclass=3Dwx.Frame)= :<br> > =A0 =A0 =A0...<original code>...<br> > #Changed original code from invoking wx.Frame =A0here to a method pass= ed down<br> > =A0 =A0 =A0 =A0 # First, call the =A0base class' __init__ method t= o create the frame<br> > =A0 =A0 =A0 =A0 =A0frameclass.__init__(self, aParent,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<a href=3D"= http://self.id" target=3D"_blank">self.id</a>,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#<a href=3D= "http://self.name" target=3D"_blank">self.name</a>,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 aBgRsrc.ti= tle,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0position,<b= r> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 aBgRsrc.si= ze,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0style | =A0= wx.NO_FULL_REPAINT_ON_RESIZE,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0aBgRsrc.nam= e)<br> > =A0 =A0...<rest of original =A0code>...<br> ><br> ><br> > class Background(BackgroundBase, wx.Frame):<br> > =A0 =A0 =A0def __init__(self, aParent, aBgRsrc):<br> > =A0 =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, aBgRs= rc,<br> > frameclass=3Dwx.Frame)<br> ><br> > class MDIParentBackground(BackgroundBase, =A0wxMDIParentFrame):<br> > =A0 =A0 def __init__(self, aParent, =A0aBgRsrc):<br> > =A0 =A0 =A0 =A0 return BackgroundBase.__init__(self, =A0aParent, aBgRs= rc,<br> > frameclass=3DwxMDIParentFrame)<br> ><br> > class =A0MDIChildBackground(BackgroundBase, wxMDIChildFrame):<br> > =A0 =A0 def =A0__init__(self, aParent, aBgRsrc):<br> > =A0 =A0 =A0 =A0 return =A0BackgroundBase.__init__(self, aParent, aBgRs= rc,<br> > frameclass=3DwxMDIChildFrame)<br> ><br> > ############## end =A0of mod to model.py #########################<br> ><br> > To use these two new =A0classes, the code is remarkably unremarkable. = =A0The parent<br> ><br> > code:<br> ><br> > ############# Parent =A0######################<br> > #!/usr/bin/python<br> ><br> > """<br> > __version__ =3D =A0"$Revision: 1.5 $"<br> > __date__ =3D "$Date: 2004/04/30 16:26:12 =A0$"<br> > """<br> ><br> > from PythonCard import =A0model<br> ><br> > MDI_rsrc=3D\<br> > {'application':{'type':'Application',<br> > =A0 =A0 =A0 =A0 =A0 =A0'name':'Template',<br> > =A0 =A0 'backgrounds': =A0[<br> > =A0 =A0 {'type':'Background',<br> > =A0 =A0 =A0 =A0 =A0 =A0'name':'bgTemplate',<br> > =A0 =A0 =A0 =A0 =A0 'title':'Testing MDI =A0Controls',= <br> > =A0 =A0 =A0 =A0 =A0 'size':(400, 300),<br> > =A0 =A0 =A0 =A0 =A0 =A0'style':['resizeable'],<br> ><br> > =A0 =A0 =A0 =A0 =A0'menubar': {'type':'MenuBar'= ;,<br> > =A0 =A0 =A0 =A0 =A0'menus': =A0[<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0{'type':'Menu',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuFile',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'&File',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'items': [<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{'type':'MenuItem&#= 39;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuFileEx= it',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'E&xit= ',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'command':'exit= 9;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {'type':'Menu',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuOptions',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'Options',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'items': [<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{'type':'MenuItem&#= 39;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuOption= sOpenNew',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'Open New\= tAlt+N',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'command':'openNew= ',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 },<br> > =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 'components': [<br> ><br> > ] # end components<br> > } # end =A0background<br> > ] # end backgrounds<br> > } =A0}<br> ><br> > MyCW_rsrc=3D\<br> > {'application':{'type':'Application',<br> > =A0 =A0 =A0 =A0 =A0 =A0'name':'Template',<br> > =A0 =A0 'backgrounds': =A0[<br> > =A0 =A0 {'type':'Background',<br> > =A0 =A0 =A0 =A0 =A0 =A0'name':'bgTemplate',<br> > =A0 =A0 =A0 =A0 =A0 'title':'Standard =A0Template with Fil= e->Exit menu',<br> > =A0 =A0 =A0 =A0 =A0 =A0'size':(698, 517),<br> > =A0 =A0 =A0 =A0 =A0 =A0'style':['resizeable'],<br> ><br> > =A0 =A0 =A0 =A0 'menubar': =A0{'type':'MenuBar'= ;,<br> > =A0 =A0 =A0 =A0 =A0'menus': [<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {'type':'Menu',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuFile',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'&File',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0'items': =A0[<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{'type':'MenuItem&#= 39;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuFileEx= it',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'E&xit= ',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'command':'exit= 9;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {'type':'Menu',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuOptions',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'Options',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 'items': [<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{'type':'MenuItem&#= 39;,<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'name':'menuOption= sOpenNew',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'label':'Open New\= tAlt+N',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'command':'openNew= ',<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 },<br> > =A0 =A0 =A0 =A0 =A0]<br> > =A0 =A0 =A0},<br> > =A0 =A0 =A0 =A0 =A0 'components': [<br> ><br> > {'type':'TextArea',<br> > =A0 =A0 =A0'name':'TextArea1',<br> > =A0 =A0 'position':(20, 20),<br> > =A0 =A0 =A0'size':(651, 333),<br> > =A0 =A0 },<br> ><br> > {'type':'Button',<br> > =A0 =A0 =A0'name':'Button1',<br> > =A0 =A0 'position':(559, 376),<br> > =A0 =A0 =A0'label':'Button1',<br> > =A0 =A0 },<br> ><br> > ] # end components<br> > } # =A0end background<br> > ] # end backgrounds<br> > } }<br> ><br> > class =A0MyBackground(model.MDIParentBackground):<br> ><br> > def on_initialize(self, =A0event):<br> > # if you have any initialization<br> > # including sizer setup, do it =A0here<br> > #MDI.on_initialize(self, event)<br> > pass<br> > def on_openNew_command ( =A0self, event ):<br> > # Create a child window<br> > child =3D model.childWindow(self, =A0MyCW, rsrc=3DMyCW_rsrc)<br> ><br> > if __name__ =3D=3D '__main__':<br> > app =3D =A0model.Application(MyBackground, None, =A0MDI_rsrc)<br> > app.MainLoop()<br> > ############# End of Parent =A0######################<br> ><br> > ############# Child =A0######################<br> > class MyCW(model.MDIChildBackground):<br> ><br> > =A0 =A0 def on_initialize(self, event):<br> > =A0 =A0 =A0 self.parent =3D =A0self.getParent()<br> > =A0 =A0 =A0 self.components.TextArea1.text=3D'I am =A0only a child= .'<br> > =A0 =A0def on_openNew_command ( self, event ):<br> > =A0 =A0 =A0 =A0return self.parent.on_openNew_command ( event )<br> > ############# =A0End of Child ######################<br> ><br> > That's it!!!<br> ><br> > Now I have =A0to play around with resizer to see how that would work h= ere.<br> ><br> > =A0--<br> > John =A0Henry<br> > <br></div></div>------------------------------------------------------= ------------------------<br> Create and publish websites with WebMatrix<br> Use the most popular FREE web apps or write code yourself;<br> WebMatrix provides all the features you need to develop and<br> publish your website. <a href=3D"http://p.sf.net/sfu/ms-webmatrix-sf" targe= t=3D"_blank">http://p.sf.net/sfu/ms-webmatrix-sf</a><br> <br>_______________________________________________<br> Pythoncard-users mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank"= >[email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/pythoncard-users" t= arget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/pythoncard-us= ers</a><br> <br></blockquote></div><font color=3D"#888888"><br><br clear=3D"all"><br>--= <br>Mark Carter, OCT<div><a href=3D"http://markcarter.tel" target=3D"_blan= k">markcarter.tel</a></div><br> <div style=3D"padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;wo= rd-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:1= 30%"> </div> </font></div><br><br clear=3D"all"><br>-- <br>Mark Carter, OCT<div><a href= =3D"http://markcarter.tel" target=3D"_blank">markcarter.tel</a></div><br> <div style=3D"visibility: hidden; left: -5000px; position: absolute; z-inde= x: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden;= word-wrap: break-word; color: black; font-size: 10px; text-align: left; li= ne-height: 130%;" id=3D"avg_ls_inline_popup"> </div> --bcaec543192c7096c3049fddb0f3-- --===============0434846936638293117== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf --===============0434846936638293117== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pythoncard-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pythoncard-users --===============0434846936638293117==--