ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Oct/Changing-Cursor

This is Changing-Cursor in view mode; [Up]


Date: Sun 07-Oct-1989 01:43:55 From: Unknown Subject: Re: Changing Cursor 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 <appkit/Cursor.h> -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 >From: ramsdell@linus.UUCP (John D. Ramsdell)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.