I guess if we wanted to make a handler really robust we
could check to make sure the event class and kind are correct as well
as the
signature & ID and the Command. That's a bit of an overkill if we
have a
single event attached to a single control but would be necessary if we
have
multiple event class & kinds attached to a window that has multiple
controls.
I code defensively, and in this case all my event handlers check for
class and kind, and signature and ID where appropriate. (And I use
asserts when things don't match, like in the default of switch on event
kind for example -- makes it easy to find errors that way).
It's just very easy to get into the habit of doing that. Then, later,
changes to your app can't as easily create unintended side effects if
your original code was defensive and you use asserts in that code to
let you know when assumptions fail.
Bryan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden