|
Re: Getting widget_button information [message #6834 is a reply to message #6830] |
Tue, 27 August 1996 00:00  |
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
|
|
|