Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!dmg From: dmg@ssc-vax.UUCP (David Geary) Newsgroups: comp.sys.amiga Subject: Re: Mouse Pointer Help Required Message-ID: <1665@ssc-vax.UUCP> Date: 8 Feb 88 22:17:31 GMT Organization: Boeing Aerospace Corp., Seattle WA Lines: 75 Keywords: Help, Mouse Pointer In Article 14707, Chuck McManis writes: >AAAAAAAAAAAAAAAAAAARRRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHH! >So close, and yet so far away. The 'clean' approved way of changing your >pointer to ANYTHING, including 'nothing' is to use the Intuition >SetPointer call. To restore it to the original preferences set pointer >you can use the Intuition ClearPointer() call. BUT THERE IS A GOTCHA! >And a very important one it is. The data you pass to SetPointer(), and >read my lips here, MUST BE IN CHIP RAM OR YOU WILL GET AN UGLY SMEAR >ON SYSTEMS WITH FAST RAM. >So, the appropriate code would be something like ... >UWORD *Newpointer = NULL; >GoAwayPointer() >{ > if (!NewPointer) NewPointer = AllocMem(2*sizeof(UWORD),MEMF_CHIP+MEMF_CLEAR); > SetPointer(NewPointer,1,1,1,1); >} > >ComeBackPointer() >{ > ClearPointer(); >} >Note also that the pointer is a sprite and follows the rules for sprite >images, meaning that each plane is represented by "n" UWORDs where n is >the number of lines high the new image is, and that you have to have >2 planes because a sprite is 3 colors (plus transparent). So 1 * 2 = 2 >UWORDs. Finally, set the hotspot to 1,1 because if you set it to 0,0 >SetPointer sometimes activates sprite 1 (for no apparent reason). Almost... The call to SetPointer should read: SetPointer(w, NewPointer,1,1,1,1); - You must send SetPointer a pointer to the window you want to change the pointer in. Also, this still leaves you with a pointer - even if it is just one pixel wide, and one pixel high. The third and fourth args to SetPointer give it a new location for the pointer. However, they are OFFSETS from the current pointer position, so if you wanted to put the one-pixel ptr at 0,0, you would: SetPointer(w, NewPointer,-(s->MouseX),-(s->MouseY),1,1); You could even try to put it offscreen like so: SetPointer(w, NewPointer,-(s->MouseX+1),-(s->MouseY+1),1,1); Note that I have tried the method of putting pointer at 0,0, cause that's what I want to do for my application. I've never tried to put it offscreen, but try it if you want... BTW, s above is a pointer to the screen your window's in... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ "... Who's gonna see that I'm fed, ~ ~ And who's gonna want me in bed, ~ ~ But who'll watch TV instead, ~ ~ Because I do..." ~ ~ ~ ~ If Not You, Dr. Hook ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- *********************************************************** * David Geary, Boeing Aerospace Co., Seattle, WA * * (206)773-5249. --I disclaim everything I've ever said--* ***********************************************************