Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Question about event handling

Name: Anonymous 2014-06-21 11:42

Let's say I use SDL (1.2 or 2.0) in my program to handle events, should I use callbacks or the good old giant switch statement?

Name: Anonymous 2014-06-22 22:16

>>73
Why are you even asking if you have already made up your mind?

>>75
You can put the closure on the observer list and call it directly instead of calling a notify method on it (because there's no need & closures don't usually have methods.)

Or you can skip this nonsense and embed the closure in the event classifier with a setter. Default lamdbas (or checked None instances) exist in the classifer as no-ops. Finally, instead of internal event classification, direct handling of events should be used whenever possible.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List