From: Kevin A. <al...@se...> - 2005-12-27 19:33:57
|
The bad news is that Robin replied to my thread on wxPython-dev, saying "Since the official policy is that overlapping widgets is not supported then I doubt anything will be done for fear of breaking something else. I expect that this behavior will be left as platform default or 'undefined' by wx." "Just FYI, on wx.GTK2 the last created is always on top, and Raise/Lower don't seem to do anything with the button widgets. :-(" The last created item always being on top is what the Mac does too, if GTK1 does the same thing, then it is Windows that is the oddball on creation order. I have no idea whether the resourceEditor in cvs behaves correctly with GTK1 or GTK2 builds of wxPython. I found that a bug report I had submitted is still open, which makes me think that we are sort of screwed on GTK2. http://sourceforge.net/tracker/? func=detail&aid=1024777&group_id=9863&atid=109863 If anyone can confirm one way or another that would be great. My simple wxPython test program for overlaps is included below along with my workaround for making the Mac behave like Windows when the widget is created. ka --- import wx print wx.VERSION class MyApp(wx.App): def OnInit(self): frame = wx.Frame(None, -1, "minimal", size=(200, 200)) panel = wx.Panel(frame, -1) self.panel = panel frame.Show(True) # creation order overlaps 'Three' on top of "Two' # on top of 'One' on Mac wxPython 2.6.1 # creation order overlaps 'One' on top of "Two' # on top of 'Three' on Win2K wxPython 2.6.2 # not tested under Linux self.btn1 = wx.Button(panel, -1, 'One', (5, 30)) if wx.Platform == '__WXMAC__': self.btn1.Lower() self.btn2 = wx.Button(panel, -1, 'Two', (35, 40)) if wx.Platform == '__WXMAC__': self.btn2.Lower() self.btn3 = wx.Button(panel, -1, 'Three', (65, 50)) if wx.Platform == '__WXMAC__': self.btn3.Lower() btnRaise = wx.Button(panel, -1, 'Reverse Overlap', (50, 100)) wx.EVT_BUTTON(self, btnRaise.GetId(), self.on_mouseClick) self.SetTopWindow(frame) return True def on_mouseClick(self, event): self.btn2.Raise() self.btn3.Raise() app = MyApp(0) app.MainLoop() |