Custom Sizer using PySizer

I've created my own simple custom sizer using PySizer. The docs suggest that
I only need to implement
two methods /CalcMin/, and /RecalcSizes/. I've done this, and I'm getting
the result I'm after. However, although /RecalcSizes/ seems critical to
achieving the desired layout, the value returned by /CalcMin/ seems
irrelevant: no matter what size I return, the layout is unaffected. Can
someone explain what /CalcMin/ is used for?

Note that in my sample app custom_sizer.py
<http://wxpython-users.1045709.n5.nabble.com/file/n5720035/custom_sizer.py>
/CalcMin/ simply returns /wx.Size(0, 0)/
(Sample app tested on OS X 10.8.5,wx 2.8.12.1)

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Custom-Sizer-using-PySizer-tp5720035.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Paul wrote:

I've created my own simple custom sizer using PySizer. The docs suggest that
I only need to implement
two methods /CalcMin/, and /RecalcSizes/. I've done this, and I'm getting
the result I'm after. However, although /RecalcSizes/ seems critical to
achieving the desired layout, the value returned by /CalcMin/ seems
irrelevant: no matter what size I return, the layout is unaffected. Can
someone explain what /CalcMin/ is used for?

CalcMin is called at least when the sizer is a child of another sizer. You can think of it as the equivalent of a window's GetMinSize, or perhaps GetBestSize. CalcMin could also be a good place to put code that pre-calculates the layout or positions of items that you may use later in RecalcSizes if it makes sense to do so. I think that is what it was originally intended for.

···

--
Robin Dunn
Software Craftsman