ex11 - brain dump 3
Joachim Durchholz
joachim.durchholz@REDACTED
Mon Jan 19 11:40:05 CET 2004
Vlad Dumitrescu wrote:
> Input events are easy to abstract out, because
> they're just messages;
Not sure what exactly you mean, but there's more than meets the eye with
input events.
You need at least two levels of events:
1) Basic IO: key press, key release, mouse button press/release, mouse move.
2) "Predigested" events: mouse click, double click, drag (and subsequent
drop), keypress, keeping a key pressed, change in shift-lock state, etc.
etc.
3) High-level events: when a window area is uncovered and must be
redrawn, when the user selects a different color scheme, to be applied
to all applications, when the user logs out, when the computer is about
to be shut down, when the contents of a text field changes, etc. etc. etc.
This is just a list of things that *can* be done using events
(incidentally, it's a list of the more whacky messages from MS Windows).
Many of these events aren't needed if everything is done in a language
that's better than C; however, there are many situations when a
"callback" (implemented by whatever means: messages, virtual functions,
a parameter/attribute of function type) is the best answer.
Just my 2c.
Regards,
Jo
--
Currently looking for a new job.
More information about the erlang-questions
mailing list