[Gambas-user] Generic event handler - is it possible?

Me adamnt42 at gmail.com
Sat Sep 29 03:58:00 CEST 2018


I was wondering if it were possible for Gambas to have a generic event handler like the Appication_Error?
This theoretical beast would handle "any" event not handled at a lower level. 

This came up because somewhere down a set of heirachical classes an (exception) event get raised that is 
not handled by the owning class.  In this case the proper handler is the main code of the application 
anyway so having to handle and reraise a new events all the way up the chain is a pain.

Example : cAuction has a collection of cVendor items, each of which has a collection of cLot items. If a CLot 
object has data which is an exception (note, exception not an error) then (stuff happens) but the matter needs
to be reported to the user, which is the job of the main code to handle the reporting.

Obviously, I don't wish to trap every event raised everywhere or we would get thousands of notices.  So, the
explicit event would need to be defined with a Propogate property or somesuch.

Anyway, just a thinky or a wishlist item.

regards
Bruce

-- 
adamant42 at gmail.com


More information about the User mailing list