Hi Steve, I download this from https://github.com/mbarbon/wx-perl-pubsub/blob/master/Build.PL
It's not a cpan however The reason of the modules are here http://www.nntp.perl.org/group/perl.wxperl.users/2010/06/msg7350.html I have use Gtk2, and the subscribe unsubscribe functions of this module seem me similar to the functions I used with Gtk signal event. Another question: I would like to have a dropdbox that list usernames and that return a userid when one select a name. Shall I use a Wx::ListBox or Wx::ListCtrl ? Can you point me to some codes examples ? Thanks François > -----Original Message----- > From: Steve Cookson - gmail [mailto:steveco.1...@gmail.com] > Sent: jeudi, 14. mai 2015 20:34 > To: wxperl-users@perl.org > Subject: Re: Help with Wx::Perl::PubSub > > Hi François, > > This is very interesting. I've not seen it before, what is it supposed > to do to events and why is it better than the standard way of handling > them? > > Regards > > Steve. > > On 12/05/15 09:29, RAPPAZ Francois wrote: > > 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 > >