[Gambas-user] Dynamic menu click event
Doriano Blengino
doriano.blengino at ...1909...
Sun Nov 16 09:32:32 CET 2008
Toni ha scritto:
> Hi Doriano, thanks for your answer!
> I have a related doubt...
> If I instantiate some Menu objects from code and I assign them all to
> the same "handling function", is there a way, inside this function, to
> know which Menu object was the one that fired the event?
>
The LAST variable is a reference to the current object (inside a event
handler). For example:
public sub buttons_click()
print LAST.text
end
will print the caption of the button which raised "click".
Salutations,
--
Doriano Blengino
"Listen twice before you speak.
This is why we have two ears, but only one mouth."
More information about the User
mailing list