Hi Randall,
I don’t know of a way to specify Monitor, but you can specify the Position of a Frame with Frame.SetPosition().
I use wxPython apps with multiple monitors all the time. At one workstation controlling my experimental station, I want wxApp # 1 to be on the left, wxApp #2 to be in the middle and wxApp #3 and #4 to be on the right (yes, all three monitors are mostly filled with wxPython apps). As it turns out, the center monitor is the “main” monitor.
Frame.SetPosition((xpos, ypos)) uses absolute coordinates, so to put an App on the left monitor, I have a basic app like this
class SomeApp(wx.App):
def __init__(self, position, maximize=True, **kws):
self.position = position
self.maximize = maximize
wx.App.__init__(self, **kws)
def createApp(self):
frame = MainFrame()
frame.SetPosition(self.position)
if self.maximize:
frame.Maximize()
frame.Show()
self.SetTopWindow(frame)
def OnInit(self):
self.createApp()
return True
if name == ‘main’:
app = SomeApp(position=(-1800, 50), maximize=True) # <-- fill the left hand monitor
app.MainLoop()
HTH,
–Matt
···
On Thu, May 24, 2018 at 1:25 PM Randall X Smith randallxsmith@gmail.com wrote:
I haven’t seen any discussion about controlling the location of wxPython apps on workstations that have multiple monitors. When invoking the wxPython app, the main frame always seems to appear on the main monitor, which may be different from the monitor you invoked it from; this can be disconcerting and easy to miss (e.g., I have 3 monitors with one off to the side; the app always appears on the one off to the side when I invoke it).
Is there any way to specify, e.g., the “current” monitor as the desired startup location, i.e., the one you invoked the app from?
(We’re in the Ubuntu 14 environment, BTW, though I assume this is an issue in all environments.)
Thanks in advance for any ideas or suggestions.
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.