wxPython Disable Frame Resizing

user825286 picture user825286 · Jul 26, 2011 · Viewed 14.5k times · Source

How can I disable a wxFrame from being resized by the user? If there's a flag to put in when creating the frame, what is it?

Answer

Cédric Julien picture Cédric Julien · Jul 26, 2011

The default window style is wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN

If you remove wx.RESIZE_BORDER from it, you'll get a frame which cannot be resized.

Something like this should do the stuff :

wx.Frame(parent, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)