|Perl: the Markov chain saw|
Re: Centring text in a WxPerl static text boxby beech (Vicar)
|on Feb 14, 2018 at 05:36 UTC||Need Help??|
The following code, based on an example in http://learnperl.scratchcomputing.com/tutorials/wxperl/, is a minimum example which is supposed to put up a StaticText control with its legend centred. Instead it is resolutely left-aligned. I have tried everything I can think of, including putting wxALIGN_CENTRE on the sizer add, calling the CentreOnParent method of the text box ... and a dozen other things I can't remember. What am I doing wrong?
What version are you using?
wxALIGN_CENTRE seems to do the trick for me, without it the text is left aligned
Perl 5.016001 Wx 0.9922 wxWidgets 2.9.4
print join( ' ', "\n", Perl => $], Wx => $Wx::VERSION, Wx::wxVERSION_STRING, "\n" );
Also, I wouldn't expect a wxVERTICAL box sizer to try to align horizontally :)