Swalif has asked for the wisdom of the Perl Monks concerning the following question:

Good day all;
I am using wxPerl to build a simple quiz program. I have this one problem where I have TextCtrl which aligns the text right but as soon as I assign value through SetValue it defaults back to left alignment ..
the creation code is :
$self->{question} = Wx::TextCtrl->new($self, -1, "", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE|wxTE_MULTILINE|wxTE_READONLY|wxTE_RIGHT);
the layout code :
$self->{grid_sizer_1}->Add($self->{question}, 0, wxEXPAND|wxALIGN_RIGHT|wxFIXED_MINSIZE|wxST_NO_AUTORESIZE, 0);
I've tried this before and after SetValue
my $style = Wx::TextAttr->new(); $style->Wx::TextAttr::SetAlignment(3); $self->{question}->SetDefaultStyle($style);

but didn't work..
any help is appreciated.

Replies are listed 'Best First'.
Re: problem with wxTextCtrl right alignment
by Anonymous Monk on Jul 20, 2011 at 06:24 UTC
      I really appreciate your quick response, this fixed the problem and worked perfect. best regards