brianm@sco.COM (Brian Moffet) (03/01/89)
A while ago, I asked people about updating the mouse pointer
in a global way (ie to change it for all windows).
I discovered a method which does work, but will probably break
in future releases of the operating system. If you are not
interested, please quit out now.
First things first:
in order to allocate and set up the memory I need for
my pointer, I make a call to GetPrefs() to get the current
preferences. From this I make a copy of the old mouse
pointer so that I can restore it when my program is finished.
I redo the pointer with my own version, and then call SetPrefs
to set the whole thing up. Immediately after this, I save
the pointer located at IntuitionBase->APointer so that I
can write to it. This is a small window where I could have
problems, but it is really small.
I figured (correctly it seems) that when intuition needs to
change the mouse pointer for a particular window, it will
just swap pointers. By saving the "known" correct pointer
I can avoid writing to pointer memory that I should not be
writing to.
Now, at 1 minute intervals, I can just load the pointer
that I have saved with a new image. Thus, I can have a
clock in my pointer. This does seem to work with
dmouse, but I may end up re-writing my program to do
the stuff dmouse does for memory savings (though not much).
I will be giving this clock/mouse program to the comp.amiga.sources
people sometime in the future. That way others can see how
to do this stuff.
Personnally, I would like to see the addition of a system call
to change the global pointer without having to go through preferences.
This would make programs like I am writing much easier and more portable
than they are now.
Thanks to all of the people out there who have made programs and
tips that enable me to do this.
Just FYI.
brian moffet
--
Brian Moffet {uunet,decvax!microsoft,ucscc}!sco!brianm
-or- ...sco!alar!brian
"I was everything you wanted me to be. You were afraid, I was frightening."
My fish and company have policies. I have opinions.cmcmanis%pepper@Sun.COM (Chuck McManis) (03/02/89)
In article <2365@scolex.sco.COM> brianm@sco.COM (Brian Moffet) writes: > >A while ago, I asked people about updating the mouse pointer >in a global way (ie to change it for all windows). We thought you might be doing a clock pointer... >I will be giving this clock/mouse program to the comp.amiga.sources >people sometime in the future. That way others can see how >to do this stuff. Isn't their one on the 1.3 Extra's disk? I wonder how Andy did it. There are a couple on fish disks I know. >Personnally, I would like to see the addition of a system call >to change the global pointer without having to go through preferences. >This would make programs like I am writing much easier and more portable >than they are now. Personnally, I would like to see someone get creative here and not mess with the intuition pointer. Rather, initialize Sprite 1 with your clock and have it follow the Pointer around. Make it so that you can set the speed in which it moves for some interesting yo-yo effects. By the way, is your clock round? Or is it one of those digital jobbies with the digits on top of one another ? I had started one that used sprites 1 and 2 to make into a single 32 X 32 clock. Never saw the light of day though. Oh well. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.
jrh@tippy.uucp (03/03/89)
Brian, I wrote a program very similar to the one that you are working on. It is called MouseClock and is on Fish Disk 69. Try it. Also, it works fine with Dmouse. John Hoffman