B4J Question Reflector - AddEventHandler, but... RemoveEventHandler?

LucaMs

Expert
Licensed User
Longtime User
You can't, just ignore the event when it happens if you don't want it
I would like to add a KeyPressed handler to the selected Item of a CustomListView and remove it when the selection changes.

I don't know if keeping the handlers active will create problems (maybe the performance hit will be insignificant).

[BTW I was hasty, since the first attempt was to add that event to the CLV but it was not the ideal solution and, at the moment, I was unable to add it to the single Item]
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
I don't know if keeping the handlers active will create problems (maybe the performance hit will be insignificant).
Totally insignificant, especially if you ignore it. Just set a flag to check in the event handler and immediately return to ignore the event if set.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…