Re: Added MDI support to Pythoncard (was MDI - childwindows within a window)
Teuvo Eloranta <[email protected]> Sat, 2 Apr 2011 12:29:06 +0300
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <[email protected]> |
--===============2371661800392480841== Content-Type: multipart/alternative; boundary=0016361e89049d7f6f049fec29cc --0016361e89049d7f6f049fec29cc Content-Type: text/plain; charset=ISO-8859-1 Hi there! It's so nice to hear people using Pythoncard, not to mention someone is (willing to) developing it. I think Pythoncard is an absolute superb tool for making GUI programs. Amazingly fast method and produces code more readable (and short) than any other (at least that i know of). I've done something earlier with wxPython, but usually it's "too much" for what I need, Pythoncard is definitely the nbr one tool I use for GUI programs. And when necessary, the missing pieces can be coded with wxPython still. For the developer, and everyone involved somehow for making pythoncard what it is today - thank you! Just wanted to add my 5 cents too :) -Teuvo 2011/4/2 John Henry <[email protected]> > I couldn't agree with you more. Earlier there was a post claiming that he > prefers wxPython over Pythoncard. I assume he's using a different animal > than the one I am looking at. Pythoncard is simple, feature rich - and very > stable. I've done numerous projects using Pythoncard. > > I've long suggested that somebody release a 1.0 version of Pythoncard. So > far, it has fallen to death ears. If we can all convince the owner to do > that, I can package up what I have done and contribute to the release. > > I've hecked together the following controls: > > pdfwindow, flashwindow, tree control, minimizable window (minimize to > Windows lauch bar), MDI parent and child windows, sashwindows, ... > > I have to stress heck because I did all these kind of blind folded because > I really don't know what's going on most of the time. Wing debugger is my > friend. > > Controls I tried but unable to get it to work: > > matplotlib window, a graphic file viewer widget (works but not behaving > properly), a MDI widget (not window). > > > > -- > John Henry > > > *From:* Mark Carter <[email protected]> > > *To:* [email protected] > *Sent:* Fri, April 1, 2011 9:13:02 AM > *Subject:* [Pythoncard-users] Added MDI support to Pythoncard (was MDI - > childwindows within a window) > > 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 > > > > ------------------------------------------------------------------------------ > 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 > > --0016361e89049d7f6f049fec29cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi there!<br><br>It's so nice to hear people using Pythoncard, not to m= ention someone is (willing to) developing it.<br>I think Pythoncard is an a= bsolute superb tool for making GUI programs. Amazingly fast method and prod= uces code more readable (and short) than any other (at least that i know of= ).<br> I've done something earlier with wxPython, but usually it's "t= oo much" for what I need, Pythoncard is definitely the nbr one tool I = use for GUI programs.<br>And when necessary, the missing pieces can be code= d with wxPython still.<br> <br>For the developer, and everyone involved somehow for making pythoncard = what it is today - thank you!<br><br>Just wanted to add=A0 my 5 cents too := )<br><br>-Teuvo<br><br><br><div class=3D"gmail_quote">2011/4/2 John Henry <= span dir=3D"ltr"><<a href=3D"mailto:[email protected]">[email protected]= </a>></span><br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex;"><div><div style=3D"font-family:'times n= ew roman', 'new york', times, serif;font-size:12pt"><div></div>= <div> I couldn't agree with you more. =A0Earlier there was a post claiming th= at he prefers wxPython over Pythoncard. =A0I assume he's using a differ= ent animal than the one I am looking at. =A0Pythoncard is simple, feature r= ich - and very stable. =A0I've done numerous projects using Pythoncard.= </div> <div><br></div><div>I've long suggested that somebody release a 1.0 ver= sion of Pythoncard. =A0So far, it has fallen to death ears. =A0 If we can a= ll convince the owner to do that, I can package up what I have done and con= tribute to the release.</div> <div><br></div><div>I've hecked together the following controls:</div><= div><br></div><div>pdfwindow, flashwindow, tree control, minimizable window= (minimize to Windows lauch bar), MDI parent and child windows, sashwindows= , ...</div><div><br></div><div>I have to stress heck because I did all these= kind of blind folded because I really don't know what's going on m= ost of the time. =A0Wing debugger is my friend.</div><div><br></div><div> Controls I tried but unable to get it to work:</div><div><br></div><div>mat= plotlib window, a graphic file viewer widget (works but not behaving proper= ly), a MDI widget (not window). =A0</div><div><br></div><div><br>=A0</div> --<br> John Henry<div><br></div><blockquote style=3D"border-left:2px solid rgb(16,= 16, 255);margin-left:5px;padding-left:5px"><div style=3D"font-family:times= new roman, new york, times, serif;font-size:12pt"><br><div style=3D"font-f= amily:times new roman, new york, times, serif;font-size:12pt"> <font face=3D"Tahoma" size=3D"2"><b><span style=3D"font-weight:bold">From:<= /span></b> Mark Carter <<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>><div class=3D"im"><br><b><span styl= e=3D"font-weight:bold">To:</span></b> <a href=3D"mailto:pythoncard-users@li= sts.sourceforge.net" target=3D"_blank">[email protected]= et</a><br> </div><b><span style=3D"font-weight:bold">Sent:</span></b> Fri, April 1, 20= 11 9:13:02 AM<br><b><span style=3D"font-weight:bold">Subject:</span></b> [P= ythoncard-users] Added MDI support to Pythoncard (was MDI - childwindows wi= thin a window)<br> </font><div><div></div><div class=3D"h5"><br> <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>On Fri,= Apr 1, 2011 at 10:53 AM, John Henry <span dir=3D"ltr"><<a rel=3D"nofoll= ow" 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> 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 <a href=3D"http://model.py" target=3D"_blank">model.py</a= > #######################<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 rel=3D"nofollow" href=3D"mailto:ecs1749@yahoo.= com" target=3D"_blank">[email protected]</a>><br> > To: <a rel=3D"nofollow" href=3D"mailto:[email protected]= rge.net" 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 rel=3D"n= ofollow" 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 rel=3D"= nofollow" 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 =A0<a href=3D"= http://aBgRsrc.name" target=3D"_blank">aBgRsrc.name</a>)<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><span> 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></span><br> <br>_______________________________________________<br> Pythoncard-users mailing list<br> <a rel=3D"nofollow" href=3D"mailto:[email protected]" = target=3D"_blank">[email protected]</a><br> <a rel=3D"nofollow" href=3D"https://lists.sourceforge.net/lists/listinfo/py= thoncard-users" target=3D"_blank">https://lists.sourceforge.net/lists/listi= nfo/pythoncard-users</a><br> <br></blockquote></div><font color=3D"#888888"><br><br clear=3D"all"><br>--= <br>Mark Carter, OCT<div><a rel=3D"nofollow" href=3D"http://markcarter.tel= " target=3D"_blank">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 rel= =3D"nofollow" href=3D"http://markcarter.tel" target=3D"_blank">markcarter.t= el</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> </div></div></div></div></blockquote><div></div> </div></div><br>-----------------------------------------------------------= -------------------<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]">Pythoncard-users@= lists.sourceforge.net</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><br> --0016361e89049d7f6f049fec29cc-- --===============2371661800392480841== 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 --===============2371661800392480841== 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 --===============2371661800392480841==--