Widget.removeEventListener

Events use a Javascript-esque model. See more details on the Event page.

addEventListener returns an opaque handle that you can later pass to removeEventListener.

addDirectEventListener just inserts a check if(e.target !is this) return; meaning it opts out of participating in handler delegation.

Use scope on your handlers when you can. While it currently does nothing, this will future-proof your code against future optimizations I want to do. Instead of copying whole event objects out if you do need to store them, just copy the properties you need.
  1. void removeEventListener(string event, EventHandler handler, bool useCapture)
    class Widget
    void
    removeEventListener
    (
    string event
    ,,
    bool useCapture = false
    )
  2. void removeEventListener(EventListener listener)

Meta