I am making a small program to draw segments in python using wxpython and ogl library. I have created and added the canvas to a sizer, but am unable to freeze the size of the canvas.
sizer = wx.BoxSizer(wx.VERTICAL)
canvas_sizer = wx.BoxSizer(wx.HORIZONTAL)
text_sizer = wx.BoxSizer(wx.HORIZONTAL)
stat = wx.StaticText(panel,-1,'position')
canvas = ogl.ShapeCanvas(panel)
diagram = ogl.Diagram()
canvas.SetDiagram(diagram)
diagram.SetCanvas(canvas)
canvas_sizer.Add(canvas,1,wx.GROW)
text_sizer.Add(stat,1,wx.ALL,5)
sizer.Add(canvas_sizer,1,wx.GROW)
sizer.Add(text_sizer)
self.SetSizer(sizer)
sizer.Fit(self)
The above code is part of my actual code. Please suggest ways to make the canvas size fixed
You must set the proportion the slot must occupy to 0 and to give the contents a minimum size in case it is required: