Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions

by stefbv (Deacon)
on Mar 25, 2013 at 17:45 UTC ( #1025356=note: print w/ replies, xml ) Need Help??


in reply to Re^2: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions
in thread wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions

Yes, hdb has a point about the OnRed method using:

$this->{listCtrl}->SetItemTextColour( 0, wxRED );

But also the event handler method is has to be written like this:

EVT_BUTTON( $self, $btnBold, sub { $self->OnBold } );

The OnBold method is in the current package.

Another remark is that you can skip all the use.+ stuff until the first package declaration in your code examples, they are not needed and is recommended to keep the posts as short as possible. It is also better for debugging, to not load unused modules.

Regards, Stefan.


Comment on Re^3: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions
Select or Download Code
Re^4: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions
by HelenCr (Monk) on Mar 25, 2013 at 21:50 UTC

    Stefan: when I change, according to yours and hdb's suggestion, the event-binding calls to:

    EVT_BUTTON ($self, $btnBold, sub { $self->OnBold }); EVT_BUTTON ($self, $btnRed, sub { $self->OnRed });

    and the methods to:

    sub OnBold { my $this = shift; my $f = $this->{listControl}->GetItemFont(0); $f->SetWeight(wxBOLD); $this->SetItemFont(0, $f); } #1 end sub OnBold sub OnRed { my $this = shift; $this->{listControl}->SetItemTextColour(0, wxRED); } #1 end sub OnRed

    You still get the same error message:

    Can't locate object method "GetItemFont" via package "Wx::ListCtrl" at + Set item font post.pl line 59 MyFrame::OnBold('MyFrame=HASH(0x2662734)') called at Set item font +post.pl line 31 MyFrame::__ANON__('MyFrame=HASH(0x2662734)', 'Wx::CommandEvent=SCAL +AR(0x2aef33c)') called at Set item font post.pl line 78 eval {...} called at Set item font post.pl line 78

    So it seems that many list control classes are not implemented in wxPerl.
    Very frustrating and disappointing. I don't know how to proceed.

    Helen

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-12-19 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (82 votes), past polls