How to set wxPython main frame at bottom right?

For a better description

+-----------------------+ | Desktop (screen) | | | | | | +----------+ | | | wxPython | | | | App. | | | | | | | | | | | +----------+ | +-----------------------+ 

Take a look at the WxPython application. which is aligned in the lower right corner of the screen. How to place my main frame, because the width of the screen is different on each PC?

For a better understanding, I want a small pop-up window, for example Digsby and FeedNotifier to use! I think both use python!

+6
python wxpython
source share
1 answer

You can use wx.DisplaySize to get the screen size as well from the window. GetSize () you can get the size of your window that you want to place, these two data are enough to place them correctly. for example, in this example, I put the MinFrame in the lower right

 import wx def alignToBottomRight(win): dw, dh = wx.DisplaySize() w, h = win.GetSize() x = dw - w y = dh - h win.SetPosition((x, y)) app = wx.PySimpleApp() frame = wx.MiniFrame(None, title="My PopUp", size=(200,300), style=wx.DEFAULT_MINIFRAME_STYLE|wx.CLOSE_BOX) alignToBottomRight(frame) app.SetTopWindow(frame) frame.Show() app.MainLoop() 
+11
source share

All Articles