remove
To remove an event handler, you must keep a reference to the handler passed to add. Do NOT use the result from find, because you may remove more than you expect.
For example, suppose you have a Button
, and add an addition MOUSE_PRESSED handler (which does something special when the middle button is pressed). The result from find would be a Compound
of Button's handler and your additional handler. Removing the Compound
would stop the button from working correctly.