3 ms·
The enum of all possible events is still there, it's just spread over dozens of different callback properties belonging to several different objects. Splitting
by WJW 5y ago
The enum of all possible events is still there, it's just spread over dozens of different callback properties belonging to several different objects. Splitting out via an enum to a big `handle` type function makes it possible to detect whether you have handled all possible events at compile time instead of having to raise an exception at runtime.
- jbverschoor 5y agoJust require a callback to be non-null.
- varajelle 5y agoI see little value in seeing that enum of all possible event on one place. On the other hand, I want to see what is the action performed by that button and there is value in having small event handler close to the thing they handle.
- verdagon 5y agoIf we had a closure, we wouldn't ever need to "handle all possible events", we would just do a virtual call. It's guaranteed to be handled.