Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

wxPerl Static Text alignment

by einhverfr (Friar)
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?

Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2017-09-26 02:45 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (291 votes). Check out past polls.