Karsten Hilbert wrote:
I don't see this on Windows. My application runs on Linux as well, but I only have two users. They use the latest wxPython on Ubuntu and they haven't mentioned that behavior. I'm sure they would if it happened though. Do you have a call to Layout() right before or right after you show the frame?
The last three lines of the main frame's __init__ are
self.SetClientSize(wx.Size(x, y)) # x and y loaded from DB
self.Center(wx.BOTH)
self.Show(True)
And the code in the wx.App subclass where the frame is set up:
frame = gmTopLevelFrame(None, -1, 'GNUmed', (640, 440))
frame.CentreOnScreen(wx.BOTH)
frame.Show(True)
self.SetTopWindow(frame)
Nothing suspicious I can see.
I suppose you could do it yourself by getting the system resolution and the frame's position. I get my frame's position like this:
self.framePosition = (self.frame.GetPosition())
Then I'd use something like this to get the resolution:
width, height = wx.GetDisplaySize()
Then do a little math and use SetPosition() to set it. Looks like Robin even had an example in this old post:
http://www.nabble.com/-wxPython--CentreOnScreen-troubles-again-td17889123.html
Still, the CentreOnScreen call should work. Unfortunately, I don't seem to have any current code that uses it...
Can you upgrade to 2.8.9.1?
Not really as it is not available for Debian, not even for unstable or experimental. I will file a Request for Packaging on it, though.
Karsten
Robin has instructions on the wiki for upgrading on Debian and Ubuntu, although I don't know if these instructions are up to date:
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian
Worth a try though, if you're the brave sort. I've used them successfully on Ubuntu before.
···
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org