Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Centring text in a WxPerl static text box

by HenryLaw (Initiate)
on Feb 14, 2018 at 19:24 UTC ( [id://1209171]=note: print w/replies, xml ) Need Help??


in reply to Re: Centring text in a WxPerl static text box
in thread Centring text in a WxPerl static text box

Spent most of the afternoon fiddling with this. I'm convinced that the wxALIGN_CENTRE flag doesn't work.

I've written a little subroutine which does what I want; it's OK but it shouldn't be necessary

sub centre_text{ # centre_text( $text_control, $container ); # Not enough error checking, really ... my ( $text_control, $container ) = @_; my ($container_width) = $container->GetSizeWH(); my ($text_width) = $container->GetTextExtent( $text_control->GetLabe +l() ); my ( $text_x, $text_y ) = $text_control->GetPositionXY(); $text_control->Move( ($container_width-$text_width)/2, $text_y ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209171]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-26 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found