TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATHIEU BOUCHARD
from: JERRY COFFIN
date: 1997-09-08 09:51:00
subject: WHY THE BRACES?

On (07 Sep 97) Mathieu Bouchard wrote to Roger Scudder...
 MB> is this about event handling? i was under the impression that MS
 MB> Windows used an OO event system, just like the X Window System and
 MB> Java both use.
Hmm....well, Windows, and X are certainly a great deal alike.  Whether
that qualifies as object-oriented is a different question.
In both cases, you recieve a data structure that describes what's just
happened.  In X, it's a struct containing a type field, followed by a
union of a number of struct's.
In Windows, it's a type field followed by two more parameters, the
meanings of which vary depending on the value of the type field.  The
two are fairly similar, but X makes a formal statement in C syntax about
how the rest of the structure varies depending on the type, where MS
leaves that up to more or less ad hoc programming.
In both cases, there are layers on top of this basic mechanism that
reduce the need for case statements and such.  In the case of X, you've
got Xt, which allows you to use XtRegisterCallback to handle a
particularly type of message.  (At least IIRC - it's been a long time
since I used X much, so I may be using the wrong name.)  In the case of
Windows, message crackers provide the same general idea, though in
somewhat different form.
 MB> Also, how is OS/2 PM programming compared to those three?
From this perspective, PM is virtually identical to Windows.  The
details of how individual messages are packed is different of course (as
it's also different between 16 and 32 bit Windows) but the general
layout is the same.
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.