Path: utzoo!attcan!uunet!ndsuvax!nopuklic From: nopuklic@ndsuvax.UUCP (Blayne Puklich) Newsgroups: comp.sys.mac.programmer Subject: Re: Highlight "OK" buttons Keywords: Dialogs Message-ID: <1240@ndsuvax.UUCP> Date: 10 Sep 88 02:07:23 GMT References: <3316@homxc.UUCP> Reply-To: nopuklic@ndsuvax.UUCP (Blayne Puklich) Organization: North Dakota State University Fargo, ND Lines: 41 In article <3316@homxc.UUCP> paco@homxc.UUCP (Herbert Throckmorton) writes: >Here's a riddle: > >Default buttons in alerts get highlighted automatically. IM vol.1 >mentions in the "Dialog Manager" section that one can highlight the >default button in a dialog as well, but IM vol.1 doesn't mention how >to do that deed, as far as I can tell. One way would be to define >the default button as a user item and write a routine to highlight >it, like in the example in that same IM section. Is there a better >way, some flag or routine not mentioned in IM? > >thanks - > > John Scoggins > att!homxc!paco John: There really is no other way to do this except for what IM I-407 says near the top of the page. Another way to do this is get the Box for the dialog item number 1 in the dialog's list, do the three calls as shown, and let it fly. Remember, though, that if you draw something over the RoundRect around the button, you'll need to redraw the RoundRect. The best way to do this would be to have a filter for the whole process of drawing the RoundRect around item 1. The filter would only act upon update events passed to it by ModalDialog for theDialog. This probably sounds like too much work, but try it out and it should work. Oh, before I forget, if you do use a filter for theDialog, you have to intercept keyboard hits for Enter and Return if you want ModalDialog to return to the caller when they are pressed. That's more like what the user guidelines say you should do. ||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|| || Blayne Puklich nopuklic@plains.NoDak.edu || || NDSU Student ACM NU087763@NDSUVM1.bitnet || || Chairperson North Dakota State University, Fargo, ND || || || || "Everyone should have a Corvette, I think." || || NOTE: If nopuklic@plains.NoDak.edu bounces, revert to || || nopuklic@ndsuvax.EDU. || ||-------------------------------------------------------------------------||