[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: device,cursor_image ??



Craig Hamilton (cah@medeng.wfubmc.edu) wrote:
: I've been trying to use a user-defined cursor via
: device,cursor_image=csr_img on an X11 Sun platform.

Craig -

I found the documentation confusing too, so once I figured it out
(v3!) I wrote a routine to translate from a bitmap to the vector.  If
you blur your eyes a little you can see the cursor shape. 

This shows up black; I'm not sure how to set the cursor color.

pro set_cursor

;
;	SET cursor shape and hot spot
;	(added per VSMR 104)
;
curs		= bytarr(16,16)
curs(0,*)	= [0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0]
curs(1,*)	= [0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]
curs(2,*)	= [0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0]
curs(3,*)	= [0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0]
curs(4,*)	= [1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0]
curs(5,*)	= [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(6,*)	= [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(7,*)	= [1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0]
curs(8,*)	= [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(9,*)	= [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(10,*)	= [1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0]
curs(11,*)	= [0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0]
curs(12,*)	= [0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0]
curs(13,*)	= [0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]
curs(14,*)	= [0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0]
curs(15,*)	= [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

power	= 2^(indgen(16))		; define power of 2 array
cursor	= intarr(16)			; cursor must be integer array
for i = 0, 15 do cursor(i) = total(curs(i,*) * power)
device, cursor_image = cursor, cursor_xy = [7,7]

end


--
-- Gwyn F. Fireman
-- General Sciences Corporation / MODIS Characterization Support Team
-- Gwyn.Fireman@gsfc.nasa.gov   301-352-2118