Automatically adjustment of wxPython Frame Size

Hi All

How to adjust the wxPython Frame Size automatically when screen resolution change?

Actually, i have just written a wxPython application, currently
Frame size is fixed. Due to this application/frame size is very large
on some screen resolutions. So, how to resize/adjust automatically
depending on the screen resolution size?

Regards,

Hi,

If the point is the screen size, you can do for instance something
like:
- you define a function like this:
def DefineScreenSize(percentscreen = None, size = None):
    """Returns a tuple to define the size of the window
       percentscreen = float
    """
    if not size and not percentscreen:
        percentscreen = 0.9
    if size:
        l, h = size
    elif percentscreen:
        x1, x2, l, h = wx.Display().GetClientArea()
        #print "ClientArea = ", l, h
        l, h = percentscreen * l, percentscreen * h
    return l, h

- Then you init your frame with:
wx.Frame.__init__(self, None,size = DefineScreenSize())

Then you can define your parameters (percentscreen or size) in a
config file.

Dominique

ยทยทยท

On Mar 11, 11:06 am, Muhammad Ammar <mam...@gmail.com> wrote:

Hi All

How to adjust the wxPython Frame Size automatically when screen resolution
change?

Actually, i have just written a wxPython application, currently Frame size
is fixed. Due to this application/frame size is very large on some screen
resolutions. So, how to resize/adjust automatically depending on the screen
resolution size?

Regards,