[comp.sys.mac.programmer] Icon Loaction on Desktop

djnowak@luna.dpl.scg.hac.com (David Nowak) (08/04/89)

    What controls the location of the trash icon on the desktop?
    Where are the coordinates stored for that icon?
    How can they be modified?

Thanks.

Dave Nowak
djnowak@luna.dpl.scg.hac.com 

freek@mel.fwi.uva.nl (Freek Wiedijk) (08/05/89)

In article <4576@hacgate.scg.hac.com> djnowak@luna.dpl.scg.hac.com (David Nowak) writes:
>
>    What controls the location of the trash icon on the desktop?
>    Where are the coordinates stored for that icon?
>    How can they be modified?
>
>Thanks.
>
>Dave Nowak
>djnowak@luna.dpl.scg.hac.com 

(At last, a question I can answer... :-) )

The location of the Trash is relative to the lower-right corner of the
screen.  The offset of the upper-left corner of the Trash icon with
respect to this point is stored in the last four bytes of CODE segment
number 3, that is the one called "Init".  (I only looked at version 6.1
of the Finder.  I don't know about older versions.)

More explicitely (on my SE):
					y coordinate	x coordinate
					============	============
lower-right corner of the screen:	 342 = $0156	 512 = $0200
last four bytes of CODE resource 3:	 -58 = $FFC6	 -56 = $FFC8
					------------ +	------------ +
upper-left corner of Trash icon:	 284 = $011C	 456 = $01C8

Notice that both offsets are negative, and that the vertical offset is
stored first (because that is the proper order for Points).

I hope this helps.  Greetings,

Freek "Digitalistengebroed" Wiedijk               Path: uunet!fwi.uva.nl!freek
#P:+/ = #+/P?*+/ = i<<*+/P?*+/ = +/i<<**P?*+/ = +/(i<<*P?)*+/ = +/+/(i<<*P?)**