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

Home » Public Forums » archive » Re: Getting widget_button information
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: Getting widget_button information [message #6830] Tue, 27 August 1996 00:00
kak is currently offline  kak
Messages: 16
Registered: February 1995
Junior Member
kak@ipp-garching.mpg.de (Karl Krieger) writes:
Oops, there is an error in my previous posting. Instead of

> "Tim_On": begin
> if not pictures2show then begin

you have to use

"Tim_On": begin
if pictures2show then begin

Cheers,

Karl
Re: Getting widget_button information [message #6834 is a reply to message #6830] Tue, 27 August 1996 00:00 Go to previous message
kak is currently offline  kak
Messages: 16
Registered: February 1995
Junior Member
fred@imagem.ibili.uc.pt writes:

> Is there any function, similar to 'get_kbrd', or other, that
> can tell if a widget_button was clicked?
> I need a function that, after showing an image, could find if
> was clicked other widget_button, before showing the next image.

> Any sugestions to: fred@imagem.ibili.uc.pt

Hmmm, let me see, I hope this solves your problem:

Say you want to show a slide show in a draw_widget with a delay between
each image. This can be done by defining a user-value for
your draw_widget and implement the following code in the event manager
routine ("Start" and "Stop" were the user values of the Start and
Stop buttons respectively):

<... get next event and corresponding user values, blabla ...>

case userval of
"Start": begin
<... prepare images and set pictures2show to # of images...>
widget_control, drawid, set_uvalue="Tim_On"
widget_control, drawid, timer=0.001 ; small delay for start
end

"Tim_On": begin
if not pictures2show then begin
<... get win-id of draw widget and draw next image in win ...>
<... decrement pictures2show by 1 ...>
endif else $
widget_control, drawid, set_uvalue="TimOff"
widget_control, drawid, timer=delay ; delay is in seconds
end

"Stop": widget_control, drawid, set_uvalue="TimOff"

"TimOff": widget_control, drawid, /destroy ; or whatever you want at end
; of loop
endcase

This way, your event loop can is checked between each image and you can
react on whatever events from buttons or other widgets.

If you still have questions, let me know or RTFM...

Cheers,

Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL FAQ
Next Topic: Linking code into IDL

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

Current Time: Fri Oct 10 05:21:36 PDT 2025

Total time taken to generate the page: 7.20211 seconds