[wxPython-users] how to get the screen size for an application

Murat Erten murerten at gmail.com
Wed Jan 3 07:16:10 PST 2007


2007/1/3, krishnakant Mane <researchbase at gmail.com>:
> hello I am new to this list.
> I am Krishnakant Mane from India.
> I have just started to use wxpython and find it really great.
> Please help me find one answer.
> when I create a wx.frame, I will like to know what is the screen size
> of the screen on which the frame is going to appear.  I was trying to
> find out a way to center the frame on the screen and expect that it
> should center itself on a 15 inch, 17 inch screen and so on.
> can some one tell me how I can achieve this?
> Krishnakant.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>

You can call frame's CenterOnScreen method like this:

frame.CenterOnScreen()

And you can get system information from wx.SystemSettings class like this:

wx.SystemSettings.GetMetric(wx.SYS_SCREEN_X)
wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y)

For further information you can look in the documentation




More information about the wxpython-users mailing list