Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!sun-barr!newstop!sun!coherent!next!aozer From: aozer@next.com (Ali Ozer) Newsgroups: comp.sys.next Subject: Re: Changing Cursor Message-ID: <118@next.com> Date: 7 Oct 89 01:43:55 GMT References: 3883@blake.acs.washington.edu Reply-To: aozer@NeXT.com (Ali Ozer) Organization: NeXT, Inc. Lines: 49 In article <3883@blake.acs.washington.edu> Mark Crispin says: >I would like to change the cursor in my application to a wait >cursor when I know the program is going to do something >time-consuming. > >I didn't see any method in Application that seemed to set the >application's cursor. The spec sheet for Cursor didn't seem to be >very helpful; the push and pop methods are interesting, but isn't it a >bit backwards to be doing this from the cursor instead of the >application? [Yes, I know, everything on the NeXT is backwards :-)] > >What I want to do is something like: > > [NXApp pushCursor:NXWait]; // save current cursor, put up wait > ... time-consuming code -- > [NXApp popCursor]; // restore cursor Cursor's push and pop methods are the way to go; essentially you need to do: #import -methodWhichTakesALongTime:sender { [NXWait push]; ... [NXWait pop]; return self; } To do what you want, you can add the pushCursor: and popCursor methods to your subclass of Application; it's trivial enough if you use the knowledge that you can send "pop" to any cursor, not the one you pushed (This is a feature that will most probably work all the time.): - pushCursor:cursor { [cursor push]; return self; } - popCursor { [NXArrow pop]; // Doesn't matter what cursor, so you can // get away with this... return self; } Ali Ozer, NeXT Developer Support Ali_Ozer@NeXT.com