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

Home » Public Forums » archive » Can I include key press events in my event loop?
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
Can I include key press events in my event loop? [message #1739] Sat, 19 February 1994 13:52
fredrick is currently offline  fredrick
Messages: 5
Registered: February 1994
Junior Member
I'm beginning to learn about IDL and it's widgets and have successfully
created a program with an event loop and different types of widgets (starting
with 'xnothing' as a model.

What I'd like to do is include key-press events in the following event
loop. How can I do it? For example, I might like to just press the "Q"
key to cause my program to quit. Here is the event loop I'm working with
which I mostly lifted from xnothing:

PRO md_control_event, ev
; ************************************************************ ************
; * Event loop for the 'md_control' program. **
; ************************************************************ ************
widget_control, ev.id, get_uvalue=value ; Realize manage & control widgets
if (n_elements(value) eq 0) then value=''
name=strmid(tag_names(ev, /structure_name), 7, 1000)
print,"DEBUG name=",name
case (name) of
"BUTTON": BEGIN
IF (value eq "DONE") then begin
WIDGET_CONTROL, /destroy, ev.top
return
ENDIF
ENDCASE
"TEXT": BEGIN
widget_control, ev.id, get_value=value, set_value=''
END
else:
ENDCASE

Thanks in advance.

--Tim Fredrick (fredrick@acd.ucar.edu)
Ntl Center for Atmospheric Research, Boulder, CO 80307-1000
Systems Administration
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Three Tools for working with IDL or PVWAVE code UPDATE.
Next Topic: Mosaic<=>IDL

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

Current Time: Sat Oct 11 04:38:51 PDT 2025

Total time taken to generate the page: 1.83211 seconds