Minimize frames in Windows

Hi,

I have application with window hierarchy like this: one main frame,
multiple children frames and each child frame can have its own
children. All frames inherit class wx.Frame.

When I minimize main frame in Windows OS, all children frames are
minimized too. In Linux for the same program code only main window is
minimized in this case.

How can I alter the program code so that minimization of main window
is not passed to all its children in Windows?
I tried to write handler for wx.EVT_ICONIZE but it seems that it
doesn't work the way I expected. Simple code like this:

···

####
wx.EVT_ICONIZE(self,self.on_minimize_frame)

def on_minimize_frame(self,event):
        print "Minimized"
####

String "Minimized" is printed when main window and all other windows
are already minimized. I hoped it would be printed before any window
is minimized,since it is first line in the "on_minimize_frame"
function.

Thanks in advance,
Marija

Hi,

I have application with window hierarchy like this: one main frame,
multiple children frames and each child frame can have its own
children. All frames inherit class wx.Frame.

When I minimize main frame in Windows OS, all children frames are
minimized too. In Linux for the same program code only main window is
minimized in this case.

This difference in behavior is due to different policies on the different platforms. IOW, each is following the behavior that is the default for the platform.

How can I alter the program code so that minimization of main window
is not passed to all its children in Windows?

Don't make them actually be children of the main window, by passing None for the parent parameter when they are created.

I tried to write handler for wx.EVT_ICONIZE but it seems that it
doesn't work the way I expected. Simple code like this:
####
wx.EVT_ICONIZE(self,self.on_minimize_frame)

def on_minimize_frame(self,event):
         print "Minimized"
####

String "Minimized" is printed when main window and all other windows
are already minimized.

It's just a notification that the minimization has happened, not a means to block it before it happens.

···

On 9/6/10 2:53 AM, Marija Velickovic wrote:

--
Robin Dunn
Software Craftsman

Hi,

> How can I alter the program code so that minimization of main window
> is not passed to all its children in Windows?

Don't make them actually be children of the main window, by passing None
for the parent parameter when they are created.

Such a simple solution! Thank you very much, it works well now.

Thanks again,
Marija