Strange Iconize behaviour?

Hey people,

I have an application with one main-frame (self.frame) and a taskbaricon.
Additionally there may be X child frames. When the main-frame is being iconized (Minimized),
the child frames should be iconized, too. I also have a wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate
Bind which should do the same.
The following code works partly; if the main-frame gets iconized via the minimize button, the child frames hide.
If the main-frame gets iconized via a doubleclick on my icon, the child frames will be minimized but still shown
in the taskbar:

# Icon:
def OnTaskBarActivate(self, evt):
        if self.frame.IsIconized():
            self.frame.Iconize(False)
            self.frame.Show(True)
            self.frame.RestoreListFrames()
            self.frame.Raise()
                   elif not self.frame.IsIconized():
            self.frame.Iconize(True)
            self.frame.Show(False)
            self.frame.HideListFrames()

def OnTaskBarMinimize(self, evt):
        if not self.frame.IsIconized():
            self.frame.Iconize(True)
               if self.frame.IsShown():
            self.frame.Show(False)

# Frame:
def HideListFrames(self):
        for name, frame in self.core.listFrames.iteritems():
            if frame != None:
                frame.Iconize(True)
                frame.Show(False)
               def RestoreListFrames(self):
        for name, frame in self.core.listFrames.iteritems():
            if frame != None:
                frame.Iconize(False)
                frame.Show(True)
               def OnMdrmaIconize(self, event):
        if self.core.tbicon != None:
            self.Show(False)
            self.HideListFrames()
                   event.Skip()

···

--
Hannes Tismer
Software Development
Medical Display Solutions

Rein EDV GmbH Jakob-Krebs-Straße 124
D-47877 Willich

Fon: +49 2156 49490 Fax: +49 2156 494939

Visit us at www.medisol.org

Hannes Tismer wrote:

Hey people,

I have an application with one main-frame (self.frame) and a taskbaricon.
Additionally there may be X child frames. When the main-frame is being iconized (Minimized),
the child frames should be iconized, too. I also have a wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate
Bind which should do the same.
The following code works partly; if the main-frame gets iconized via the minimize button, the child frames hide.
If the main-frame gets iconized via a doubleclick on my icon, the child frames will be minimized but still shown
in the taskbar:

I can't tell from this code snippet what the problem might be, but I notice that you are both Iconizing and Hiding your main frame. I assume that you are hiding it because you don't want it to show up in the task bar, and to just be accessible from the system tray. If that is the case then you can just use Hide and Show and not worry about Iconize at all. Maybe that will simplify things enough that you can figure out your other problem as well.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!