Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Modeless dialogs, what am I doing wrong? Message-ID: <8070@hoptoad.uucp> Date: 20 Jul 89 03:58:51 GMT References: <1484@ndmath.UUCP> <14455@dartvax.Dartmouth.EDU> <8029@hoptoad.uucp> <14490@dartvax.Dartmouth.EDU> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 34 In article <14490@dartvax.Dartmouth.EDU> earleh@northstar.dartmouth.edu (Earle Horton) writes: > If you're using modeless dialogs, you might also want to set the >mouse cursor to the iBeamCursor cursor whenever the mouse is in an >active editText item. > >plugh = GetCursor(iBeamCursor); >GetMouse(&plover); >if( xyzzy == (DialogPeek)FrontWindow()){ > if(PtInRect(mouse,&(*xyzzy->textH)->viewRect)){ > SetCursor(*plugh); > }else{ > SetCursor(&qd.arrow); > } >} > I was kind of wondering how Mr. Mahoney gets around his >philosophical problem with DialogPeek here. Well, Mr. Norton (or should I say, Emperor Norton), you use the FindDItem call. As it says in Inside Mac IV-60, "FindDItem is useful for changing the cursor when it's over a particular item." Something along the lines of: if (Rom85 > 0 && (item = FindDItem(win, &where)) >= 0) { GetDItem(win, ++item, &type, &h, &box); if (type == editText || type == editText + itemDisable) SetCursor(*GetCursor(iBeamCursor)); else SetCursor(&arrow); } -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Please help support the moratorium on meaningless quotes in .signatures." -- Doug Asherman on rec.music.cd