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

Home » Public Forums » archive » Re: Activating window using cursor
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: Activating window using cursor [message #7201] Mon, 21 October 1996 00:00
paul is currently offline  paul
Messages: 22
Registered: June 1991
Junior Member
In article <3266495F.250F537C@tls-tautenburg.de> Bringfried Stecklum <stecklum@tls-tautenburg.de> writes:

Hi,

I didn't find a solution for the following problem in the manuals.
So, here's the question. I want to make a random choice of images
being displayed in individual windows. How can I pass the window
ID to IDL just by moving the cursor onto the window (and perhaps
clicking there)? Usually, the cursor works only on the activated
window. Any solution without widgets?



This works for me:


pro wselect
;+
; ROUTINE: wselect
;
; PURPOSE: wset to window selected by a mouse click
;
; USEAGE: wselect
;
; INPUT: none
;
; OUTPUT: none
;
; SIDE EFFECTS:
; changes current window (changes value of !d.window)
;
; author: Paul Ricchiazzi 11jan94
; Institute for Computational Earth System Science
; University of California, Santa Barbara
;-
;
device,window_state=ws
nw=n_elements(ws)
chosen=-1
repeat begin
for i=0,nw-1 do begin
if ws(i) eq 1 then begin
wset,i
cursor,xdum,ydum,/device,/nowait
if !err ne 0 then chosen=i
endif
endfor
endrep until chosen ne -1
wset,chosen
cursor,xdum,ydum,/device,/up
end
--

____________________________________________________________ _______________
Paul Ricchiazzi
Institute for Computational Earth System Science (ICESS)
University of California, Santa Barbara

email: paul@icess.ucsb.edu
____________________________________________________________ _______________
Re: Activating window using cursor [message #7205 is a reply to message #7201] Sun, 20 October 1996 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Bringfried Stecklum <stecklum@tls-tautenburg.de> writes:

> I didn't find a solution for the following problem in the manuals.
> So, here's the question. I want to make a random choice of images
> being displayed in individual windows. How can I pass the window
> ID to IDL just by moving the cursor onto the window (and perhaps
> clicking there)? Usually, the cursor works only on the activated
> window.

> Any solution without widgets?

No. There is no way to get the kind of information you need from
a regular IDL window. There are several possible solutions with
draw widget windows. In fact, you could probably figure out a
way to use draw widgets in your regular IDL program and
achieve what you want. I would experiment with widget
tracking events and using WIDGET_EVENT from your non-
widget IDL program to find out what window the cursor is
located in. You could do this, for example, from a normal
IDL loop.

Yours,

David

--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Here's a stupid question...
Next Topic: IDL FAQ

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

Current Time: Wed Oct 08 20:02:36 PDT 2025

Total time taken to generate the page: 0.01484 seconds