Windows 10, wxPython 4.0.6, Python 3.7.4
I create several sub wx.Frame with style: wx.MINIMIZE_BOX | wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT. When sub frames are showing, after minimize->restore the main frame by clicking the icon on taskbar, the sub frames’ showing order are changed.
Sample code:
import wx
class MainFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, id=-1, parent=parent, size=wx.Size(600, 500),
title='Test')
self.panel = wx.Panel(self, id=-1, pos=(200, 300))
self.button = wx.Button(self.panel, id=-1, label='button',
pos=wx.Point(20, 56), size=wx.Size(87, 28))
self.button.Bind(wx.EVT_BUTTON, self.OnButton, id=-1)
self.frame1 = MyFrame(self, 'frame1')
self.frame2 = MyFrame(self, 'frame2')
self.frame3 = MyFrame(self, 'frame3')
def OnButton(self, event):
self.frame1.Show()
self.frame2.Show()
self.frame3.Show()
event.Skip()
class MyFrame(wx.Frame):
def __init__(self, parent, title):
style = wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | \
wx.MINIMIZE_BOX | wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT
wx.Frame.__init__(self, id=-1, parent=parent, size=wx.Size(300, 200),
title=title, style=style)
if __name__ == '__main__':
app = wx.App()
frame = MainFrame(None)
frame.Show()
app.MainLoop()
Operations:
- Click the button.
->The order (from bottom to top): frame1->frame2->frame3 - Click the icon on taskbar to minimize, then restore.
->The order changed (from bottom to top): frame1->frame3->frame2