OK I'm making some progress. The event passes $self and $event
to the subroutine.
So I can use a handler that looks like this:
sub __called_by_events {
if ($event->GetEventType()=wxEVT_COMMAND_BUTTON_CLICKED) {
do this_processing();
}
But then I want to find out which control was clicked so I use
$self->GetId() and I get "-205". What is this?
And there are other event codes like 10114, when I expected
wxEVT_COMMAND_KILL_FOCUS - 10202.
Where can I find a table that tells me what 10114 and other codes are?
Have a good day.
Regards
Steve
_____
From: Steve Cookson [mailto:[email protected]]
Sent: 10 August 2009 00:16
To: [email protected]
Subject: Distinguishing between event types
Hi,
I have a number of events that call the same subroutine. The events may
be a mixture of button events or lose focus events and I need to process
differently depending on which event it is.
Eg, A search button is the same a change value of text field and exit (loose
focus). But if the whole screen has lost focus because another application
has been clicked on nothing happens.
Ie in pseudo code:
sub __called_by_events {
if ((loose focus for field and not loose focus window) or press button)
{do something}
return;
}
But its not clear to me what methods work for both focus events and button
events
without getting an 'undefined' error. Also I'm struggling with the syntax.
Regards
Steve
<<Blank Bkgrd.gif>>
