Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!brutus.cs.uiuc.edu!apple!well!oster From: oster@well.sf.ca.us (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: How to hilite(255) the OK button in SF dialogs? Message-ID: <19099@well.sf.ca.us> Date: 18 Jul 90 10:24:23 GMT References: <2418@speedy.mcnc.org> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 40 Here is an example of disabling the OK button. See IM on SFGetFile for more info. #define INITPITEM -1 #define DISABLE 255 /* GetCIHandle - return handle value of dialog item */ ControlHandle GetCIHandle(i)Integer i;{ Integer theType; Handle theHandle; Rect theRect; GetDItem(thePort, i, &theType, &theHandle, &theRect); return (ControlHandle) theHandle; } /* OpenFilter - act on an item before SFPGetFile sees it. */ pascal Integer OpenFilter(i, dp)Integer i; DialogPtr dp;{ GrafPtr savePort; Str255 s; switch(i){ case INITPITEM : GetPort(&savePort); SetPort(dp); HilteControl(GetCIHandle(OK), DISABLE); SetPort(savePort); break; } return i; } SFGetFile(SFWhere(getDlgID), (StringPtr) "", NIL, sizeof(types)/sizeof(OSType), (SFTypeList *) types, (ProcPtr) OpenFilter, &reply); -- -- David Phillip Oster - Note new address. Old one has gone Bye Bye. -- oster@well.sf.ca.us = {backbone}!well!oster