Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!cornell!batcomputer!hsgj From: hsgj@batcomputer.tn.cornell.edu (Dan Green) Newsgroups: comp.sys.amiga Subject: Re: Mouse Pointer Help Required Keywords: Help,Mouse Pointer Message-ID: <3542@batcomputer.tn.cornell.edu> Date: 1 Feb 88 01:30:53 GMT References: <168@gould.doc.ic.ac.uk> Reply-To: hsgj@tcgould.tn.cornell.edu (Dan Green) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 83 In article <168@gould.doc.ic.ac.uk> zmacv91@doc.ic.ac.uk (Peter Walkley) writes: >My friend wants a CLEAN way of getting rid of the mouse pointer, and >then being able to restore it again. He's writing a demo that grabs >the display (i.e Ignores intuition), and wants the MP out of the way. > P. Walkley Here is a method I clipped out from a program of mine. It works, and I sure HOPE its "approved", but I don't know for sure. Note that this example replaces the arrow with another image -- for your purposes, just set this image to all 0's, or don't even bother with the image and in the for() loop just jam 0's into the array. But I am getting ahead of myself... By the way, make sure "intuition.library" is opened, and that you include stuff, at least intuition.h, preferences.h (v1.2), and types.h. Since you are not using intuition, make sure that you run pointer_new BEFORE your hack, and pointer_old AFTER you hack and when intuition is back in action. Otherwise, you'll be in hot water... ------ code ----- /* Sprite Image data used when replacing pointer with image */ USHORT pointer_image[] = { 0, 0, /* Don't touch these two words */ 0x7FFF, 0x0000, /* NEW POINTER IMAGE STARTS HERE */ 0x6083, 0x1FFC, 0x4081, 0x3FFE, 0x4E39, 0x3FFE, 0x4E39, 0x3FFE, 0x4E39, 0x3FFE, 0x4E39, 0x3FFE, 0x4E39, 0x3FFE, 0x4001, 0x3FFE, 0x4001, 0x3FFE, 0x4001, 0x3FFE, 0x4001, 0x3FFE, 0x4001, 0x3FFE, 0x6003, 0x1FFC, 0x7007, 0x0FF8, 0x7FFF, 0x0000, /* NEW POINTER IMAGE ENDS HERE */ 0, 0 /* Don't touch these two words */ }; USHORT OldPointer[POINTERSIZE]; /* Saves old mouse pointer */ /* * pointer_new() * Replace pointer with the new image. */ void pointer_new() { struct Preferences prefs; int i; /* Save mouse pointer and fill pointer with new image */ GetPrefs(&prefs,sizeof(struct Preferences)); for (i = 0; i < POINTERSIZE; i++) { OldPointer[i] = prefs.PointerMatrix[i]; prefs.PointerMatrix[i] = pointer_image[i]; } SetPrefs(&prefs,sizeof(struct Preferences),TRUE); } /* * pointer_old() * Turn pointer from the new image back to its original form */ void pointer_old() { struct Preferences prefs; int i; /* Restore mouse image */ GetPrefs(&prefs,sizeof(struct Preferences)); for (i = 0; i < POINTERSIZE; i++) prefs.PointerMatrix[i] = OldPointer[i]; SetPrefs(&prefs,sizeof(struct Preferences),TRUE); } --- end code --- -- Dan Green -- ARPA: hsgj@tcgould.tn.cornell.edu UUCP: ihnp4!cornell!batcomputer!hsgj BITNET: hsgj@cornella