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&#39;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&#39;ve done something earlier with wxPython, but usually it&#39;s &quot;t=
oo much&quot; 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">&lt;<a href=3D"mailto:[email protected]">[email protected]=
</a>&gt;</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:&#39;times n=
ew roman&#39;, &#39;new york&#39;, times, serif;font-size:12pt"><div></div>=
<div>

I couldn&#39;t agree with you more. =A0Earlier there was a post claiming th=
at he prefers wxPython over Pythoncard. =A0I assume he&#39;s using a differ=
ent animal than the one I am looking at. =A0Pythoncard is simple, feature r=
ich - and very stable. =A0I&#39;ve done numerous projects using Pythoncard.=
</div>

<div><br></div><div>I&#39;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&#39;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&#39;t know what&#39;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 &lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;<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&#39;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&#39;t recall).=A0 Most people who r=
esearch PythonCard these days just assume it&#39;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">&lt;<a rel=3D"nofoll=
ow" href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</=
a>&gt;</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&#39;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&#39;t see the screen shot, shout and I&#39;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>
&gt; From: John Henry &lt;<a rel=3D"nofollow" href=3D"mailto:ecs1749@yahoo.=
com" target=3D"_blank">[email protected]</a>&gt;<br>
&gt; To: <a rel=3D"nofollow" href=3D"mailto:[email protected]=
rge.net" target=3D"_blank">[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 withi=
n a<br>
&gt;window)<br>
&gt;<br>
&gt; I am happy to let you know that I succeeded in adding MDI support to P=
ythoncard<br>
&gt;<br>
&gt; with only a few lines of modifications to the Background class in mode=
l.py<br>
&gt;<br>
&gt; I made the Background =A0class into a BackgroundBase class, and have t=
he<br>
&gt;Background<br>
&gt;<br>
&gt; class subclass =A0from the BackgroundBase class.<br>
&gt;<br>
&gt; Then I added a MDIParentBackground =A0and MDIChildBackground which sim=
ply force<br>
&gt; Background to subclass from =A0wxMDIParentFrame and wxMDIChildFrame re=
spectively,<br>
&gt;<br>
&gt; instead of the wx.Frame =A0class. =A0 Once I&#39;ve done that, wxPytho=
n does the rest<br>
&gt;of<br>
&gt;<br>
&gt; the =A0work.<br>
&gt;<br>
&gt; ################ mod to model.py ######################<br>
&gt;<br>
&gt; from =A0wxPython.wx import wxMDIParentFrame, wxMDIChildFrame<br>
&gt;<br>
&gt; # Used to say:<br>
&gt; # =A0class BackgroundBase(Scriptable, wx.Frame, =A0event.EventSource):=
<br>
&gt; class =A0BackgroundBase(Scriptable, event.EventSource):<br>
&gt; =A0 =A0 &quot;&quot;&quot;<br>
&gt; =A0 =A0 =A0A window that contains Widgets.<br>
&gt; =A0 =A0 &quot;&quot;&quot;<br>
&gt; =A0 =A0 def =A0__init__(self, aParent, aBgRsrc, frameclass=3Dwx.Frame)=
:<br>
&gt; =A0 =A0 =A0...&lt;original code&gt;...<br>
&gt; #Changed original code from invoking wx.Frame =A0here to a method pass=
ed down<br>
&gt; =A0 =A0 =A0 =A0 # First, call the =A0base class&#39; __init__ method t=
o create the frame<br>
&gt; =A0 =A0 =A0 =A0 =A0frameclass.__init__(self, aParent,<br>
&gt; =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>
&gt; =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>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 aBgRsrc.ti=
tle,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0position,<b=
r>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 aBgRsrc.si=
ze,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0style | =A0=
wx.NO_FULL_REPAINT_ON_RESIZE,<br>
&gt; =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>
&gt; =A0 =A0...&lt;rest of original =A0code&gt;...<br>
&gt;<br>
&gt;<br>
&gt; class Background(BackgroundBase, wx.Frame):<br>
&gt; =A0 =A0 =A0def __init__(self, aParent, aBgRsrc):<br>
&gt; =A0 =A0 =A0 =A0 =A0return BackgroundBase.__init__(self, aParent, aBgRs=
rc,<br>
&gt; frameclass=3Dwx.Frame)<br>
&gt;<br>
&gt; class MDIParentBackground(BackgroundBase, =A0wxMDIParentFrame):<br>
&gt; =A0 =A0 def __init__(self, aParent, =A0aBgRsrc):<br>
&gt; =A0 =A0 =A0 =A0 return BackgroundBase.__init__(self, =A0aParent, aBgRs=
rc,<br>
&gt; frameclass=3DwxMDIParentFrame)<br>
&gt;<br>
&gt; class =A0MDIChildBackground(BackgroundBase, wxMDIChildFrame):<br>
&gt; =A0 =A0 def =A0__init__(self, aParent, aBgRsrc):<br>
&gt; =A0 =A0 =A0 =A0 return =A0BackgroundBase.__init__(self, aParent, aBgRs=
rc,<br>
&gt; frameclass=3DwxMDIChildFrame)<br>
&gt;<br>
&gt; ############## end =A0of mod to model.py #########################<br>
&gt;<br>
&gt; To use these two new =A0classes, the code is remarkably unremarkable. =
=A0The parent<br>
&gt;<br>
&gt; code:<br>
&gt;<br>
&gt; ############# Parent =A0######################<br>
&gt; #!/usr/bin/python<br>
&gt;<br>
&gt; &quot;&quot;&quot;<br>
&gt; __version__ =3D =A0&quot;$Revision: 1.5 $&quot;<br>
&gt; __date__ =3D &quot;$Date: 2004/04/30 16:26:12 =A0$&quot;<br>
&gt; &quot;&quot;&quot;<br>
&gt;<br>
&gt; from PythonCard import =A0model<br>
&gt;<br>
&gt; MDI_rsrc=3D\<br>
&gt; {&#39;application&#39;:{&#39;type&#39;:&#39;Application&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;name&#39;:&#39;Template&#39;,<br>
&gt; =A0 =A0 &#39;backgrounds&#39;: =A0[<br>
&gt; =A0 =A0 {&#39;type&#39;:&#39;Background&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;name&#39;:&#39;bgTemplate&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 &#39;title&#39;:&#39;Testing MDI =A0Controls&#39;,=
<br>
&gt; =A0 =A0 =A0 =A0 =A0 &#39;size&#39;:(400, 300),<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;style&#39;:[&#39;resizeable&#39;],<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 =A0&#39;menubar&#39;: {&#39;type&#39;:&#39;MenuBar&#39=
;,<br>
&gt; =A0 =A0 =A0 =A0 =A0&#39;menus&#39;: =A0[<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0{&#39;type&#39;:&#39;Menu&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuFile&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;&amp;File&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;items&#39;: [<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{&#39;type&#39;:&#39;MenuItem&#=
39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuFileEx=
it&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;E&amp;xit=
&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;command&#39;:&#39;exit&#3=
9;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 {&#39;type&#39;:&#39;Menu&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuOptions&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;Options&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;items&#39;: [<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{&#39;type&#39;:&#39;MenuItem&#=
39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuOption=
sOpenNew&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;Open New\=
tAlt+N&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;command&#39;:&#39;openNew=
&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 },<br>
&gt; =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 &#39;components&#39;: [<br>
&gt;<br>
&gt; ] # end components<br>
&gt; } # end =A0background<br>
&gt; ] # end backgrounds<br>
&gt; } =A0}<br>
&gt;<br>
&gt; MyCW_rsrc=3D\<br>
&gt; {&#39;application&#39;:{&#39;type&#39;:&#39;Application&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;name&#39;:&#39;Template&#39;,<br>
&gt; =A0 =A0 &#39;backgrounds&#39;: =A0[<br>
&gt; =A0 =A0 {&#39;type&#39;:&#39;Background&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;name&#39;:&#39;bgTemplate&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 &#39;title&#39;:&#39;Standard =A0Template with Fil=
e-&gt;Exit menu&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;size&#39;:(698, 517),<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0&#39;style&#39;:[&#39;resizeable&#39;],<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 &#39;menubar&#39;: =A0{&#39;type&#39;:&#39;MenuBar&#39=
;,<br>
&gt; =A0 =A0 =A0 =A0 =A0&#39;menus&#39;: [<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 {&#39;type&#39;:&#39;Menu&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuFile&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;&amp;File&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0&#39;items&#39;: =A0[<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{&#39;type&#39;:&#39;MenuItem&#=
39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuFileEx=
it&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;E&amp;xit=
&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;command&#39;:&#39;exit&#3=
9;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 {&#39;type&#39;:&#39;Menu&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuOptions&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;Options&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;items&#39;: [<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{&#39;type&#39;:&#39;MenuItem&#=
39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;name&#39;:&#39;menuOption=
sOpenNew&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;label&#39;:&#39;Open New\=
tAlt+N&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &#39;command&#39;:&#39;openNew=
&#39;,<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 },<br>
&gt; =A0 =A0 =A0 =A0 =A0]<br>
&gt; =A0 =A0 =A0},<br>
&gt; =A0 =A0 =A0 =A0 =A0 &#39;components&#39;: [<br>
&gt;<br>
&gt; {&#39;type&#39;:&#39;TextArea&#39;,<br>
&gt; =A0 =A0 =A0&#39;name&#39;:&#39;TextArea1&#39;,<br>
&gt; =A0 =A0 &#39;position&#39;:(20, 20),<br>
&gt; =A0 =A0 =A0&#39;size&#39;:(651, 333),<br>
&gt; =A0 =A0 },<br>
&gt;<br>
&gt; {&#39;type&#39;:&#39;Button&#39;,<br>
&gt; =A0 =A0 =A0&#39;name&#39;:&#39;Button1&#39;,<br>
&gt; =A0 =A0 &#39;position&#39;:(559, 376),<br>
&gt; =A0 =A0 =A0&#39;label&#39;:&#39;Button1&#39;,<br>
&gt; =A0 =A0 },<br>
&gt;<br>
&gt; ] # end components<br>
&gt; } # =A0end background<br>
&gt; ] # end backgrounds<br>
&gt; } }<br>
&gt;<br>
&gt; class =A0MyBackground(model.MDIParentBackground):<br>
&gt;<br>
&gt; def on_initialize(self, =A0event):<br>
&gt; # if you have any initialization<br>
&gt; # including sizer setup, do it =A0here<br>
&gt; #MDI.on_initialize(self, event)<br>
&gt; pass<br>
&gt; def on_openNew_command ( =A0self, event ):<br>
&gt; # Create a child window<br>
&gt; child =3D model.childWindow(self, =A0MyCW, rsrc=3DMyCW_rsrc)<br>
&gt;<br>
&gt; if __name__ =3D=3D &#39;__main__&#39;:<br>
&gt; app =3D =A0model.Application(MyBackground, None, =A0MDI_rsrc)<br>
&gt; app.MainLoop()<br>
&gt; ############# End of Parent =A0######################<br>
&gt;<br>
&gt; ############# Child =A0######################<br>
&gt; class MyCW(model.MDIChildBackground):<br>
&gt;<br>
&gt; =A0 =A0 def on_initialize(self, event):<br>
&gt; =A0 =A0 =A0 self.parent =3D =A0self.getParent()<br>
&gt; =A0 =A0 =A0 self.components.TextArea1.text=3D&#39;I am =A0only a child=
.&#39;<br>
&gt; =A0 =A0def on_openNew_command ( self, event ):<br>
&gt; =A0 =A0 =A0 =A0return self.parent.on_openNew_command ( event )<br>
&gt; ############# =A0End of Child ######################<br>
&gt;<br>
&gt; That&#39;s it!!!<br>
&gt;<br>
&gt; Now I have =A0to play around with resizer to see how that would work h=
ere.<br>
&gt;<br>
&gt; =A0--<br>
&gt; John =A0Henry<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 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==--