Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

Comment on wxPerl Static Text alignment
Select or Download Code
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 web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2016-05-26 22:44 GMT
Find Nodes?
    Voting Booth?