Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-08-21 07:31 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (318 votes). Check out past polls.