Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!olivea!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Button Hilite in Modeless Dlog? Message-ID: <10694@goofy.Apple.COM> Date: 12 Oct 90 16:52:18 GMT References: <90284.150113PL430331@tecmtyvm.mty.itesm.mx> Organization: Apple Computer Inc., Cupertino, CA Lines: 33 PL430331@tecmtyvm.mty.itesm.mx writes: > Anybody know how hilite the buttons in a modeless dialog when a key is >pressed, I do currently: > >if Key in [13,3] then *Check if it Return of enter* > begin > GetDItem(TheDialog,OK,TypeItem,ItemHandle,TheBox); > * get the rect of button to hilite it * > InvertRect(TheBox); *Invert the bits of the Rect * > Delay(5, TheCount); *wait a certain amount of time* > InvertRect(TheBox); *Invert the bits of the Rect again * > ItemHit:=OK; * assign the event of button to the var ItemHit * > end; > >Could be make it of better manner?. Yes, a better way is to use the Control Manager to hilite the control for you. Instead of the InvertRects, how about: HiliteControl(ControlHandle(itemHandle),inButton); Delay(5,theCount); HiliteControl(ControlHandle(itemHandle),0); steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ whoami? Steve Christensen snail: Apple Computer, 20525 Mariani Ave, MS-81CS, Cupertino, CA 95014 Internet: stevec@goofy.apple.com AppleLink: stevec CompuServe: 76174,1712