comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: changing cursor, general GUI questions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: changing cursor, general GUI questions [message #1727] Tue, 22 February 1994 07:31
jacobsen is currently offline  jacobsen
Messages: 28
Registered: July 1992
Junior Member
To change the cursor in IDL to a bitmap, look at the keywords
to "device,..." in the X windows section of Chapter 3 of the
IDL reference guide. You can set the cursor to a bitmap you
provide.

I suppose you could write your own X routines to be called by
IDL to avoid using IDL widgets, but I like widgets because
IDL on any machine (Unix/X, VMS/X, Dos/Windows, Mac) has
widget calls which look the same.

--
*******************
Chris Jacobsen, Asst. Prof., Department of Physics, SUNY at Stony Brook
Phone (516) 632-8093, FAX -8101 Bitnet: cjacobsen@sbccmail
jacobsen@xray1.physics.sunysb.edu ALL-IN_ONE: CJACOBSEN
*******************
Re: changing cursor, general GUI questions [message #1729 is a reply to message #1727] Tue, 22 February 1994 05:39 Go to previous message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article 2kcgiuINN1t4@i32.sma.ch, stl@sma.ch (Stephen Strebel) writes:
> Hello,
>
> does anyone know how to change the cursor in IDL to say, a hand, or
> anything? (I am running idl 3.5 on a sparc 10, SOlaris 1.0) I need
> this (currently) to build a panning/grabbing tool for images.
>
...>
> stephen Strebel
> --



Hi


The main idea is to use: DEVICE, CURSOR_STANDARD=x

(on my system x=58,...61 sets the cursor to different shapes of hands)


I've appended a short routine to display different cursors available.

karl

P.S.: Sorry for the "GOTO's"

____________________________________________________________ __________________
__ ____ __
/ // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922
/ // /_/ // / University of Hannover fax: +49 511 - 762 2483
/ // ____// / Institute for Photogrammetry
/ // / / / Nienburger Str.1
/_//_/ /_/ FRG 30167 Hannover 1 email: knipp@ipi.uni-hannover.de


vvvvvvvvvvvvvvvvvvvvv CUT HERE vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
;+
pro demo_x_cursor, l_0, l_1

; demonstrates different cursor-figures under X-Windows
; ------------------------------------------------------------ ------------------
; START OF DESCRIPTION
;
; subroutine IPI, U Hannover 09'91, modified 11'92
;
; METHOD: demonstrates different cursor-figures under X-Windows
;
; uses device, cursor_standard = l
; click left button: l = l + 1
; middle " : l = l - 1
; right " : QUIT
;
; INPUT PARAMETER: l_0, l_1 loop-indices [def.; 0, 30]
; OUTPUT PARAMETER: none
; KEYWORDS : none
;
; EXAMPLE:
;
; demo_x_cursor
;
; END OF DESCRIPTION
; ------------------------------------------------------------ ------------------
;-

; ------------------------------------------------------------ ------------------
; test input

if n_params() ne 0 and n_params() ne 2 then begin
print,"The number of parameters was wrong:",n_params()
doc_library,"demo_x_cursor"
return
endif

if n_params() eq 0 then begin
l_0 = 0
l_1 = 30
endif

d1 = l_0 < l_1
d2 = l_0 > l_1
l_0 = d1
l_1 = d2


window, /free, xsize=256,ysize=256
text1 = 'LB to continue RB to exit'

if !d.name ne 'X' then begin
xyouts, 32, 256-64, text1, font=0, /device
xyouts, 32, 256-128,'WARNING : device is NOT x but : '+!d.name, $
font=0, /device
cursor, x, y, /wait, /dev
wait, 0.125
if !err eq 4 then goto, FINITUM
endif

polyfill, [31, 95, 95, 32], [31, 31, 95, 95], color=!d.n_colors-1, /dev
polyfill, 128+[31, 95, 95, 32], [31, 31, 95, 95], color=get_grey(), /dev


; ------------------------------------------------------------ ------------------
; test input

device, /cursor_crosshair
tvcrs, 128,64, /dev
text2 = 'device, /cursor_crosshair'
xyouts, 32, 256-64, text1, font=0, /device
xyouts, 32, 256-128, text2, font=0, /device
cursor, x, y, /wait, /dev
wait, 0.125
if !err eq 4 then goto, FINITUM
erase

polyfill, [31, 95, 95, 32], [31, 31, 95, 95], color=!d.n_colors-1, /dev
polyfill, 128+[31, 95, 95, 32], [31, 31, 95, 95], color=get_grey(), /dev



device, /cursor_original
tvcrs, 128,64, /dev
text2 = 'device, /cursor_orignal'
xyouts, 32, 256-64, text1, font=0, /device
xyouts, 32, 256-128, text2, font=0, /device
cursor, x, y, /wait, /dev
wait, 0.125
if !err eq 4 then goto, FINITUM
erase

polyfill, [31, 95, 95, 32], [31, 31, 95, 95], color=!d.n_colors-1, /dev
polyfill, 128+[31, 95, 95, 32], [31, 31, 95, 95], color=get_grey(), /dev

l=l_0
while l ne l_1 do begin
device, cursor_standard = l
tvcrs, 128+64,64, /dev
text2 = 'device, cursor_standard = '+strcompress(string(l))
xyouts, 32, 256-64, text1, font=0, /device
xyouts, 32, 256-128, text2, font=0, /device
polyfill, [31, 95, 95, 32], [31, 31, 95, 95], color=!d.n_colors-1, /dev
polyfill, 128+[31, 95, 95, 32], [31, 31, 95, 95], color=get_grey(), /dev
cursor, x, y, /wait, /dev
wait, 0.125
if !err eq 4 then goto, FINITUM
if !err eq 2 then l = l-1 else l = l+1
erase
endwhile


FINITUM :

device, /cursor_original
wdelete

return
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: changing cursor, general GUI questions
Next Topic: Problem with structures getting padded to multiples of 4-bytes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:18:24 PDT 2025

Total time taken to generate the page: 0.00501 seconds