[Gambas-user] Event handler in descendent class

Benoît Minisini gambas at ...1...
Sun Dec 13 01:35:46 CET 2009


> Is there a way for a specialised class to have an event handler for an
>  event raised in the base class?
> 
> Specifically in this case I have a scaffolding class "workCodeTableItem"
> that inherits "CodeTableItem", adds a few scaffold attributes and I have
>  now found that one of these attributes needs to be set in response to an
>  event that is raised at quite a few places in the base class.
> 
> tia
> Bruce
> 

You must use an Observer, that allows you to intercept any event raised by any 
object.

Nota bene: events are not raise by a class, but by an object. But I think you 
just said "class" as a shortcut for "object of the class".

So look at the Observer class documentation, and tell me if you have any 
question.

Regards,

-- 
Benoît Minisini




More information about the User mailing list