From: Schmoger, D. <dan...@sa...> - 2006-10-13 12:03:12
|
Hi Brad, please try this code to fake an event: my $event =3D Wx::CommandEvent->new(wxEVT_COMMAND_BUTTON_CLICKED,$button->GetId);=20 $window->AddPendingEvent($event); It works in my app without problems. In your example i'd suggest: sub _evt_button_b { my $self =3D shift; my $evt =3D shift $evt->SetId ($self->{button_a}->GetId); $self->AddPendingEvent($evt); } Regards, Daniel =20 -----Original Message----- From: wxp...@li... [mailto:wxp...@li...] On Behalf Of Bradley K. Embree Sent: Freitag, 13. Oktober 2006 07:35 To: wxperl >> "Wxp...@Li..." Subject: [wxperl-users] Faking Events A coworker of mine asked about this previously,=20 http://sourceforge.net/mailarchive/forum.php?thread_id=3D30118212&forum_i= d =3D3459,=20 and I am working on implementing our testing strategy. Based on input from Mattia in the above thread, and thanks to=20 wxEvent::SetEventObject now being wrapped, I'm attempting to generate=20 events with the following code: my $event =3D Wx::CommandEvent->new(wxEVT_COMMAND_BUTTON_CLICKED); $event->SetEventObject( $button ); $window->GetEventHandler()->ProcessEvent($event); See the attached minimal example and you'll understand what I am trying=20 to accomplish. There are no error messages, but it is not working. Am I missing=20 something? Doing something wrong? I'm not sure where to go from here and any help would be appreciated. Thanks, Brad |