On Dec 16, 2005, at 3:32 AM, Alex Tweedly wrote:
> MWP...@cs... wrote: The program I am writing has a screen capture=20=
> feature and I need to know how to minimize the app when this is chosen=20=
> and restore the screen when the capture has been completed....I have=20=
> tried to search through the mailing lists to see if this question has=20=
> been asked but Im drawing a blank....any help would be greatly=20
> appreciated.You can call
> =A0=A0 self.Iconize()=A0
>
> e.g.
> =A0=A0 def on_initialize(self, event):
> =A0=A0=A0=A0=A0=A0 self.Iconize()
>
> and to restore afterwards do
> =A0=A0=A0=A0=A0=A0=A0 self.Iconize(False)
>
> and you can check the current status by
> =A0=A0=A0=A0=A0=A0=A0=A0 self.IsIconized()
>
> Further options are documented in the wxWidgets docs under=20
> "wxTopLevelWindow"
>
> --=20
> Alex Tweedly http://www.tweedly.net
I've added new background properties 'minimized' and 'maximized' for=20
release 0.8.2, so Alex's code examples above become:
def on_initialize(self, event):
self.minimized =3D True
self.minimized =3D False
to check the state, just check the property self.minimized, this is=20
identical to how the visible property works for backgrounds. Remember=20
that there are also minimize, maximize, and restore events for the=20
background so you can respond to the user changing the window if=20
needed. The change was simple, so you can add the following lines below=20=
the visible property line in model.py if you would like:
maximized =3D property(wx.Frame.IsMaximized, wx.Frame.Maximize,=20
doc=3D"whether the background window is maximized")
minimized =3D property(wx.Frame.IsIconized, wx.Frame.Iconize,=20
doc=3D"whether the background window is minimized")
ka
|