From: "Mattia Barbon" <[EMAIL PROTECTED]>
On Tue, 20 Nov 2007 19:01:45 +0200
"Octavian Rasnita" <[EMAIL PROTECTED]> wrote:

Is it possible to use just default control IDs (-1) in a WxPerl application?

With other words, if we find the controlID using $event->GetId() in an event
handler, can we access the control's properties and methods?

 There also is $event->GetEventObject.

Ok, thank you. It seems that there is another thing I don't know...

I have tried in the event handler subroutine:

my $label = $event->GetEventObject->GetLabel;

...but it works only for some controls, like the button, however it doesn't work for the menus.

How can I find the label of a menu item from a $event object if I don't know the ID of that menu item? Or better said, how can I find the label of the control that fired the event, no matter what type of control is?

I might fire an event with a menu item, with a toolbar button, and with a common button, and from $event I want to know which of the controls fired it. Is it possible?

Thank you.

Octavian

Reply via email to