creating white cursors [message #26313] |
Thu, 16 August 2001 10:07  |
Rick Baer
Messages: 6 Registered: November 1999
|
Junior Member |
|
|
I understand how to use the "cursor_image" and "cursor_mask" keywords
of the device command to create a new black cursor pattern. What can I
do to create a white cursor, like the default "cursor_crosshair"?
Rick Baer
Agilent Technologies
rick_baer@agilent.com
|
|
|
Re: creating white cursors [message #26372 is a reply to message #26313] |
Mon, 20 August 2001 12:39  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Hi,
I don't know much about managing the system cursor, but there is simple
(and pretty fast) way of plotting a pseudo-cursor on the display. I use
this when I have multiple images displayed in a widget and the user
wants to know how they correspond pixel-to-pixel. It's only for direct
graphics.
I would copy the graphic window into a pixmap. When ever a motion event
occurs, copy the pixmap into the graphic window, then follow with a
PLOTS command to draw the cursor symbol you want.
PRO MyDrawEvent, event
;I assumed that you have the necessary information stored in the top
level base's uValue
Widget_Control, event.top, Get_Uvalue = Info, /No_copy
If event.type EQ 2 then begin
;copy the graphic from the pixmap to the window
Wset, Info.DrawWin
Device, Copy = [0,0, winXsize,winYsize,0,0, Info.PixMap]
;plot your pseudo-cursor; the only time I notice a lag
;is when the cursor is moved really quickly.
PlotS, event.X, event.Y, psym = 1, color = mycolor, /Device
EndIf
Widget_Control, event.top, Set_Uvalue = Info, /No_copy
End
I would be interested in knowing how to fiddle with the system cursor
more adeptly. I have often wished for a crosshair cursor with the
middle of it missing (so it won't hide the covered pixel.)
Ben
Rick Baer wrote:
>
> I understand how to use the "cursor_image" and "cursor_mask" keywords
> of the device command to create a new black cursor pattern. What can I
> do to create a white cursor, like the default "cursor_crosshair"?
>
> Rick Baer
> Agilent Technologies
> rick_baer@agilent.com
--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org
|
|
|