Repositioning StaticText after label update

Call Layout after you update the widget's label.

Something else that I've found sometimes works a little better is to use the alignment flag as part of the statictext's style parameter, along with wx.ST_NO_AUTORESIZE, and to use wx.EXPAND when adding it to the sizer. Then the statictext widget itself will actually be the full size given to it by the sizer, but it will draw its label centered within that space based on the style flag used.

···

On 8/29/12 7:57 AM, Jacob Abel wrote:

InstrumentPanel.Data is the wx.StaticText that is updated, and I want it to stay centered. Obviously I need to change wx.ALIGN_LEFT to wx.ALIGN_CENTER_HORIZONTAL, but how do I get it to stay absolutely centered?

--
Robin Dunn
Software Craftsman