[comp.sys.mac.programmer] Implementing close box on DA subwindows

dce@smsc.sony.com (David Elliott) (01/05/90)

One of the DAs I am using has a main window which has a close box,
and also creates subwindows.  These subwindows don't have close
boxes (thus requiring a "Close Window" menu item) because (according
to the creator) any DA windows that get closed via a close box
cause the DA to close.

Is there a way to implement subwindow close boxes?

I would expect that you could redefine the close box code in some
way, but I'm not experienced in these matters.

-- 
David Elliott
dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
(408)944-4073
"But Pee Wee... I don't wanna be the baby!"

urlichs@smurf.ira.uka.de (01/06/90)

In comp.sys.mac.programmer dce@smsc.Sony.COM (David Elliott) writes:
< 
< Is there a way to implement subwindow close boxes?
< 
Yes.

Oh, you also want to know _how_? Well..

If the user clicks into your close box, your DA's close routine gets called.
It then should close the frontmost window (which presumably is the one which
the user clicked the close box of) and return an _error_ to prevent the Desk
manager from deallocating your DA.

Simple, huh?

Disclaimer: This doesn't work on 64k ROMs.
-- 
Matthias Urlichs