[comp.sys.mac.programmer] Custom messages and part codes for window defprocs

rick@jessica.Stanford.EDU (Rick Wong) (08/10/90)

I'm writing a custom window definition proc in which I'd like to have
another widget (like the close box and zoom box) in the title bar.  Has
Apple defined any protocol for assigning values to custom message
selectors and window part codes?  Is it safe, for example, to use
values >= 1000?

Also, I noticed that the part code returned by FindWindow is not equal
to the value returned by the WDEF's hit routine.  Rather, FindWindow
adds 2 to it, provided it is >= 2.  (This maps wInDrag -> inDrag,
wInGrow -> inGrow, etc.)  Consequently, if my hit routine returns
1000, FindWindow returns 1002.  Is this behavior etched in ROM forever
and ever, never to be changed even if Apple realizes how dumb it is?

Finally, if I pass the custom part code returned by FindWindow back
to TrackBox, is it safe to assume that it will call the WDEF's draw
routine with "param" equal to the part code mapped back to the original
value that the hit routine returned (thus indicating that I should xor
the widget)?  It certainly seems TrackBox was designed to handle custom
widgets (note that it isn't named "TrackZoomBox"), and this is indeed
how it behaves currently.

As always, many thanks for any Information.

Rick Wong
rick@jessica.stanford.edu