Help with Wx::Perl::PubSub

[email protected] (RAPPAZ Francois)
Newsgroups perl.wxperl.users
Message-ID <[email protected]>
I would like to bind a TextChanged event with a Wx::TextCtrl.

I have this that works:

EVT_TEXT($frame, $w, sub{$self->Test($w)});
Where $frame is the top level frame, $w the field that emit the signal.

I'm trying to use the Wx::Perl::PubSub module, but none of these works

$w->subscribe('TextChanged', sub{$self->Test($w)} );
Does nothing

$w->subscribe('TextChanged', $self, 'Test');
Crash with
not a code ref at C:/strawberry/perl/site/lib/Wx/Perl/PubSub.pm line 377.
        Wx::Perl::PubSub::emit(Wx::TextCtrl=SCALAR(0x4bd19bc), "TextChanged", "1
0.1111/tpj.12544-modd") called at C:/strawberry/perl/site/lib/Wx/Perl/PubSub.pm
line 390
        Wx::Perl::PubSub::emit_event(Wx::TextCtrl=SCALAR(0x4bd19bc), Wx::Command
Event=SCALAR(0x406fcec), "TextChanged", "10.1111/tpj.12544-modd") called at C:/s
trawberry/perl/site/lib/Wx/Perl/PubSub/Events.pm line 205
        Wx::Perl::PubSub::Events::_Wx_TextCtrl_TextChanged(Wx::TextCtrl=SCALAR(0
x4bd19bc), Wx::CommandEvent=SCALAR(0x406fcec)) called at U:\docs\perl\wxw\refsui
.pl line 26
        eval {...} called at U:\docs\perl\wxw\refsui.pl line 26


$w->subscribe('TextChanged', $frame, 'Test');
Remains silent

Where Test is
sub Test {
my ($self, $w) = @_;
print $w->GetValue. "\n";

}

Thanks for any help

François
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.