Re: Added MDI support to Pythoncard (was MDI - childwindows within a window)

John Henry <[email protected]> Fri, 1 Apr 2011 15:43:45 -0700 (PDT)
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
--===============4740399014933998001==
Content-Type: multipart/alternative; boundary="0-1184220370-1301697825=:10753"

--0-1184220370-1301697825=:10753
Content-Type: text/plain; charset=us-ascii

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
>
--0-1184220370-1301697825=:10753
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div></div><div>I couldn't agree with you more. &nbsp;Earlier there was a post claiming that he prefers wxPython over Pythoncard. &nbsp;I assume he's using a different animal than the one I am looking at. &nbsp;Pythoncard is simple, feature rich - and very stable. &nbsp;I've done numerous projects using Pythoncard.</div><div><br></div><div>I've long suggested that somebody release a 1.0 version of Pythoncard. &nbsp;So far, it has fallen to death ears. &nbsp; If we can all convince the owner to do that, I can package up what I have done and contribute to the release.</div><div><br></div><div>I've hecked together the following c
 ontrols:</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 most of the time. &nbsp;Wing debugger is my friend.</div><div><br></div><div>Controls I tried but unable to get it to work:</div><div><br></div><div>matplotlib window, a graphic file viewer widget (works but not behaving properly), a MDI widget (not window). &nbsp;</div><div><br></div><div><br>&nbsp;</div>--<br>John Henry<div><br></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma"><b><span style="font-weight: b
 old;">From:</span></b> Mark Carter &lt;[email protected]&gt;<br><b><span style="font-weight: bold;">To:</span></b> [email protected]<br><b><span
 style="font-weight: bold;">Sent:</span></b> Fri, April 1, 2011 9:13:02 AM<br><b><span style="font-weight: bold;">Subject:</span></b> [Pythoncard-users] Added MDI support to Pythoncard (was MDI - childwindows within a window)<br></font><br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div class="gmail_quote">Hi John.<br><br>Awesome!&nbsp; Good to know someone is still developing PythonCard!&nbsp; 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.<br>


<br>I don't suppose you could shepherd through a new release?&nbsp; The current release is several years old IIRC, and the installer has issues (either with Vista and/or latest Python, can't recall).&nbsp; Most people who research PythonCard these days just assume it's a dead project.<br>


<br>Mark<br><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Apr 1, 2011 at 10:53 AM, John Henry <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:[email protected]" target="_blank" href="mailto:[email protected]">[email protected]</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">
I am happy to report that I've succeeded in Pythoncardize<br>
the wx.SashLayoutWindow control of wxPython<br>
&nbsp;using similar technique to the MDI support I reported previously. &nbsp; Not sure if<br>
the screen capture attachment to this email will get stripped or not. &nbsp;If you<br>
don't see the screen shot, shout and I'll try to upload that somewhere.<br>
<br>
########## mod to <a target="_blank" href="http://model.py">model.py</a> #######################<br>
class Background(BackgroundBase, wx.Frame):<br>
 &nbsp; &nbsp;def __init__(self, aParent, aBgRsrc, init=None):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return BackgroundBase.__init__(self, aParent, aBgRsrc,<br>
frameclass=wx.Frame, init=init)<br>
<br>
class MDIChildBackground(BackgroundBase, wx.MDIChildFrame):<br>
 &nbsp; &nbsp;def __init__(self, aParent, aBgRsrc, init=None):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return BackgroundBase.__init__(self, aParent, aBgRsrc,<br>
frameclass=wx.MDIChildFrame, init=init)<br>
<br>
class MDIParentBackground(BackgroundBase, wx.MDIParentFrame):<br>
 &nbsp; &nbsp;def __init__(self, aParent, aBgRsrc, init=None):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return BackgroundBase.__init__(self, aParent, aBgRsrc,<br>
frameclass=wx.MDIParentFrame, init=init)<br>
<br>
class SashWindow(BackgroundBase, wx.SashLayoutWindow):<br>
 &nbsp; &nbsp;def __init__(self, aParent, aBgRsrc, init=None):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;rsrc = resource.Resource(aBgRsrc).application.backgrounds[0]<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return BackgroundBase.__init__(self, aParent, rsrc,<br>
frameclass=wx.SashLayoutWindow, init=init)<br>
&nbsp;# Dummy routine<br>
 &nbsp; &nbsp;def SetMenuBar(self, child):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return<br>
 &nbsp; &nbsp;# Dummy routine<br>
 &nbsp; &nbsp;def GetStatusBar(self):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return<br>
########## end of mod to model.py #######################--<br>
John Henry<br>
<br>
<br>
<br>
----- Original Message ----<br>
&gt; From: John Henry &lt;<a rel="nofollow" ymailto="mailto:[email protected]" target="_blank" href="mailto:[email protected]">[email protected]</a>&gt;<br>
&gt; To: <a rel="nofollow" ymailto="mailto:[email protected]" target="_blank" href="mailto:[email protected]">[email protected]</a><br>
&gt; Sent: Wed, March 9, 2011 10:08:39 AM<br>
&gt; Subject: Added MDI support to Pythoncard (was MDI - childwindows within a<br>
&gt;window)<br>
&gt;<br>
&gt; I am happy to let you know that I succeeded in adding MDI support to Pythoncard<br>
&gt;<br>
&gt; with only a few lines of modifications to the Background class in model.py<br>
&gt;<br>
&gt; I made the Background &nbsp;class into a BackgroundBase class, and have the<br>
&gt;Background<br>
&gt;<br>
&gt; class subclass &nbsp;from the BackgroundBase class.<br>
&gt;<br>
&gt; Then I added a MDIParentBackground &nbsp;and MDIChildBackground which simply force<br>
&gt; Background to subclass from &nbsp;wxMDIParentFrame and wxMDIChildFrame respectively,<br>
&gt;<br>
&gt; instead of the wx.Frame &nbsp;class. &nbsp; Once I've done that, wxPython does the rest<br>
&gt;of<br>
&gt;<br>
&gt; the &nbsp;work.<br>
&gt;<br>
&gt; ################ mod to model.py ######################<br>
&gt;<br>
&gt; from &nbsp;wxPython.wx import wxMDIParentFrame, wxMDIChildFrame<br>
&gt;<br>
&gt; # Used to say:<br>
&gt; # &nbsp;class BackgroundBase(Scriptable, wx.Frame, &nbsp;event.EventSource):<br>
&gt; class &nbsp;BackgroundBase(Scriptable, event.EventSource):<br>
&gt; &nbsp; &nbsp; """<br>
&gt; &nbsp; &nbsp; &nbsp;A window that contains Widgets.<br>
&gt; &nbsp; &nbsp; """<br>
&gt; &nbsp; &nbsp; def &nbsp;__init__(self, aParent, aBgRsrc, frameclass=wx.Frame):<br>
&gt; &nbsp; &nbsp; &nbsp;...&lt;original code&gt;...<br>
&gt; #Changed original code from invoking wx.Frame &nbsp;here to a method passed down<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; # First, call the &nbsp;base class' __init__ method to create the frame<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;frameclass.__init__(self, aParent,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a rel="nofollow" target="_blank" href="http://self.id">self.id</a>,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#<a rel="nofollow" target="_blank" href="http://self.name">self.name</a>,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aBgRsrc.title,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;position,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aBgRsrc.size,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;style | &nbsp;wx.NO_FULL_REPAINT_ON_RESIZE,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a target="_blank" href="http://aBgRsrc.name">aBgRsrc.name</a>)<br>
&gt; &nbsp; &nbsp;...&lt;rest of original &nbsp;code&gt;...<br>
&gt;<br>
&gt;<br>
&gt; class Background(BackgroundBase, wx.Frame):<br>
&gt; &nbsp; &nbsp; &nbsp;def __init__(self, aParent, aBgRsrc):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return BackgroundBase.__init__(self, aParent, aBgRsrc,<br>
&gt; frameclass=wx.Frame)<br>
&gt;<br>
&gt; class MDIParentBackground(BackgroundBase, &nbsp;wxMDIParentFrame):<br>
&gt; &nbsp; &nbsp; def __init__(self, aParent, &nbsp;aBgRsrc):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; return BackgroundBase.__init__(self, &nbsp;aParent, aBgRsrc,<br>
&gt; frameclass=wxMDIParentFrame)<br>
&gt;<br>
&gt; class &nbsp;MDIChildBackground(BackgroundBase, wxMDIChildFrame):<br>
&gt; &nbsp; &nbsp; def &nbsp;__init__(self, aParent, aBgRsrc):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; return &nbsp;BackgroundBase.__init__(self, aParent, aBgRsrc,<br>
&gt; frameclass=wxMDIChildFrame)<br>
&gt;<br>
&gt; ############## end &nbsp;of mod to model.py #########################<br>
&gt;<br>
&gt; To use these two new &nbsp;classes, the code is remarkably unremarkable. &nbsp;The parent<br>
&gt;<br>
&gt; code:<br>
&gt;<br>
&gt; ############# Parent &nbsp;######################<br>
&gt; #!/usr/bin/python<br>
&gt;<br>
&gt; """<br>
&gt; __version__ = &nbsp;"$Revision: 1.5 $"<br>
&gt; __date__ = "$Date: 2004/04/30 16:26:12 &nbsp;$"<br>
&gt; """<br>
&gt;<br>
&gt; from PythonCard import &nbsp;model<br>
&gt;<br>
&gt; MDI_rsrc=\<br>
&gt; {'application':{'type':'Application',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'name':'Template',<br>
&gt; &nbsp; &nbsp; 'backgrounds': &nbsp;[<br>
&gt; &nbsp; &nbsp; {'type':'Background',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'name':'bgTemplate',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'title':'Testing MDI &nbsp;Controls',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'size':(400, 300),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'style':['resizeable'],<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'menubar': {'type':'MenuBar',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'menus': &nbsp;[<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{'type':'Menu',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuFile',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'&amp;File',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'items': [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{'type':'MenuItem',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuFileExit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'E&amp;xit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'command':'exit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {'type':'Menu',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuOptions',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'Options',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'items': [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{'type':'MenuItem',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuOptionsOpenNew',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'Open New\tAlt+N',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'command':'openNew',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'components': [<br>
&gt;<br>
&gt; ] # end components<br>
&gt; } # end &nbsp;background<br>
&gt; ] # end backgrounds<br>
&gt; } &nbsp;}<br>
&gt;<br>
&gt; MyCW_rsrc=\<br>
&gt; {'application':{'type':'Application',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'name':'Template',<br>
&gt; &nbsp; &nbsp; 'backgrounds': &nbsp;[<br>
&gt; &nbsp; &nbsp; {'type':'Background',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'name':'bgTemplate',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'title':'Standard &nbsp;Template with File-&gt;Exit menu',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'size':(698, 517),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'style':['resizeable'],<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; 'menubar': &nbsp;{'type':'MenuBar',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'menus': [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {'type':'Menu',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuFile',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'&amp;File',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'items': &nbsp;[<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{'type':'MenuItem',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuFileExit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'E&amp;xit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'command':'exit',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {'type':'Menu',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuOptions',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'Options',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'items': [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{'type':'MenuItem',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'name':'menuOptionsOpenNew',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'label':'Open New\tAlt+N',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'command':'openNew',<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
&gt; &nbsp; &nbsp; &nbsp;},<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'components': [<br>
&gt;<br>
&gt; {'type':'TextArea',<br>
&gt; &nbsp; &nbsp; &nbsp;'name':'TextArea1',<br>
&gt; &nbsp; &nbsp; 'position':(20, 20),<br>
&gt; &nbsp; &nbsp; &nbsp;'size':(651, 333),<br>
&gt; &nbsp; &nbsp; },<br>
&gt;<br>
&gt; {'type':'Button',<br>
&gt; &nbsp; &nbsp; &nbsp;'name':'Button1',<br>
&gt; &nbsp; &nbsp; 'position':(559, 376),<br>
&gt; &nbsp; &nbsp; &nbsp;'label':'Button1',<br>
&gt; &nbsp; &nbsp; },<br>
&gt;<br>
&gt; ] # end components<br>
&gt; } # &nbsp;end background<br>
&gt; ] # end backgrounds<br>
&gt; } }<br>
&gt;<br>
&gt; class &nbsp;MyBackground(model.MDIParentBackground):<br>
&gt;<br>
&gt; def on_initialize(self, &nbsp;event):<br>
&gt; # if you have any initialization<br>
&gt; # including sizer setup, do it &nbsp;here<br>
&gt; #MDI.on_initialize(self, event)<br>
&gt; pass<br>
&gt; def on_openNew_command ( &nbsp;self, event ):<br>
&gt; # Create a child window<br>
&gt; child = model.childWindow(self, &nbsp;MyCW, rsrc=MyCW_rsrc)<br>
&gt;<br>
&gt; if __name__ == '__main__':<br>
&gt; app = &nbsp;model.Application(MyBackground, None, &nbsp;MDI_rsrc)<br>
&gt; app.MainLoop()<br>
&gt; ############# End of Parent &nbsp;######################<br>
&gt;<br>
&gt; ############# Child &nbsp;######################<br>
&gt; class MyCW(model.MDIChildBackground):<br>
&gt;<br>
&gt; &nbsp; &nbsp; def on_initialize(self, event):<br>
&gt; &nbsp; &nbsp; &nbsp; self.parent = &nbsp;self.getParent()<br>
&gt; &nbsp; &nbsp; &nbsp; self.components.TextArea1.text='I am &nbsp;only a child.'<br>
&gt; &nbsp; &nbsp;def on_openNew_command ( self, event ):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;return self.parent.on_openNew_command ( event )<br>
&gt; ############# &nbsp;End of Child ######################<br>
&gt;<br>
&gt; That's it!!!<br>
&gt;<br>
&gt; Now I have &nbsp;to play around with resizer to see how that would work here.<br>
&gt;<br>
&gt; &nbsp;--<br>
&gt; John &nbsp;Henry<br>
&gt; <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 target="_blank" href="http://p.sf.net/sfu/ms-webmatrix-sf">http://p.sf.net/sfu/ms-webmatrix-sf</a></span><br>
<br>_______________________________________________<br>
Pythoncard-users mailing list<br>
<a rel="nofollow" ymailto="mailto:[email protected]" target="_blank" href="mailto:[email protected]">[email protected]</a><br>
<a rel="nofollow" target="_blank" href="https://lists.sourceforge.net/lists/listinfo/pythoncard-users">https://lists.sourceforge.net/lists/listinfo/pythoncard-users</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Mark Carter, OCT<div><a rel="nofollow" target="_blank" href="http://markcarter.tel">markcarter.tel</a></div><br>
<div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%;">
</div>
</font></div><br><br clear="all"><br>-- <br>Mark Carter, OCT<div><a rel="nofollow" target="_blank" href="http://markcarter.tel">markcarter.tel</a></div><br>
<div style="visibility:hidden;padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%;" id="avg_ls_inline_popup">

</div>
<meta http-equiv="x-dns-prefetch-control" content="on"></div></div></blockquote><div style="position:fixed"></div>


</div></body></html>
--0-1184220370-1301697825=:10753--


--===============4740399014933998001==
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

--===============4740399014933998001==
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

--===============4740399014933998001==--