Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
We don't bite newbies here... much
 
PerlMonks  

wxPerl Static Text alignment

by einhverfr (Scribe)
on Nov 08, 2013 at 09:10 UTC ( #1061683=perlquestion: print w/ replies, xml ) Need Help??
einhverfr has asked for the wisdom of the Perl Monks concerning the following question:

I am writing a point of sale program in wxPerl and having an issue with formatting text using the StaticText control.

I am trying to get labels and numbers to align right, but currently it is not working. I have tried this:

Wx::StaticText->new($self->{WxPanel}, -1, 'Total: ', [10, 280], [90, 24] )->SetWindowStyleFlag(wxALIGN_RIGHT); $self->{total} = Wx::StaticText->new($self->{WxPanel}, -1, $self->{parent_window}->{total}->GetL +abel, [100, 280], [90, 24] ); $self->{total}->SetWindowStyleFlag(wxALIGN_RIGHT);

and this

Wx::StaticText->new($self->{WxPanel}, -1, 'Total: ', [10, 280], [90, 24], wxALIGN_RIGHT); $self->{total} = Wx::StaticText->new($self->{WxPanel}, -1, $self->{parent_window}->{total}->GetL +abel, [100, 280], [90, 24], wxALIGN_RIGHT);

I have also tried refreshing the current pane, all to no avail. What am I doing wrong? What's the preferred way to do this?

Comment on wxPerl Static Text alignment
Select or Download Code
Re: wxPerl Static Text alignment
by Anonymous Monk on Nov 08, 2013 at 09:16 UTC

    What am I doing wrong? What's the preferred way to do this?

    You're not using sizers

      I tried, and couldn't find a way that would still allow me to place things in specific locations elsewhere in the window. When I tried this no matter what I tried, the sizers took over and put everything near the top of the window. I may just have to rethink my design a bit.
        Um, use more panels, more sizers, more inside each other?
        [ Draw a picture? ][ ] [ ][ ] [ ] :kinda ] [ ] :like ] [ like: [ ] [ this: [ ] [here: [ ]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1061683]
Approved by Corion
Front-paged by bulk88
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-04-20 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls