开发者

Automatically adjustment of wxPython Frame Size

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 au开发者_Python百科tomatically depending on the screen resolution size?

Regards,


Why can't you start app as maximized and let user resize it to whatever size he wants? otherwise if you must set a size based on display size use wx.DisplaySize() to get size of display e.g.

import wx

app = wx.PySimpleApp()
displaySize= wx.DisplaySize()
mainFrame = wx.Frame(None, title="hmmm", size=(displaySize[0]/2, displaySize[1]/2))
mainFrame.Show()
app.SetTopWindow(mainFrame)
app.MainLoop()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜