[wxPython-users] Rescuing children frames
Raffaello Barella
barbarossa.platz at gmail.com
Fri Feb 29 01:01:49 PST 2008
Thanks.
EVT_ACTIVATE will do for my present needs.
wx.FRAME_FLOAT_ON_PARENT might get useful in a different context: where can
I find some dovcumentation on it?
2008/2/28, Robin Dunn <robin at alldunn.com>:
>
> Raffaello Barella wrote:
> > In his book, Robin Dunn recommended to make a spare use of MDI frames. I
> > followed his advice and now feel much happier, with only one setback:
> > if my application gets hidden on the screen by one or more different
> > ones, clicking the icon in the bar raises only the parent frame and not
> > its children. I solved this menial problem by adding the following code
> > to the parent:
> > in __init__:
> > self.Bind(wx.EVT_PAINT, self.OnPaint)
> > and then:
> > def OnPaint(self, event):
> > event.Skip()
> > children =3D self.GetChildren()
> > for j in range(len(children)):
> > if isinstance(children[j], wx.Frame):
> > children[j].Raise()
> >
> > Since the user is supposed to have some use for a child frame when
> > she/he opens it, I suggest to make this the standard behavior of the
> > parent frame. But, sorry, I am not yet able to write the underlying C++
> > code.
>
>
> You really don't want to do something like that in the EVT_PAINT event,
> as it could cause an endless cascade of paint events in some situations.
> A better choice would be to use EVT_ACTIVATE, or perhaps to just use a
> style flag like wx.FRAME_FLOAT_ON_PARENT for the child frames if that
> fits your needs.
>
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
29/8e060bba/attachment.htm
More information about the wxpython-users
mailing list