wxpython fixed frame size?
Is it possible to create a frame with a fixed size, so the user can not change the size of the frame ?
wx.Frame.__init__(self, None, -1, 'Hello',wx.DefaultPosition,(400, 300))
I'm using python 2.7
开发者_如何学编程
thanks
Yes it is possible -
wx.Frame.__init__(None, -1, 'Title', style= wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
Another option is to remove the RESIZE_BORDER flag from the Frames style bitmask but keep the default frame style. You'll want to disable the maximize box too.
i.e)
style = wx.DEFAULT_FRAME_STYLE & ~wx.MAXIMIZE_BOX ^ wx.RESIZE_BORDER
You can also use SetSizeHints to control how big or how small you want to resize it or not resize the frame at all.
精彩评论