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

Home » Public Forums » archive » Re: wait loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: wait loop [message #26647 is a reply to message #26645] Thu, 20 September 2001 06:51 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ronn Kling (ronn@rlkling.com) writes:

> What you want to use is a timer event for widgets. This doesn't use any cpu
> time until the event fires off. If you don't have any widgets as part of
> your program you can still create a simple base and keep map=0 so that it
> never becomes visible.

Because I wasn't sure if an unmapped widget could
actually receive a timer event, I just coded a file-
seeking program up. Here it is. Note no error
checking!

************************************************
PRO TestForFile_Event, event
Widget_Control, event.top, Get_UValue=filename
dummy = Findfile(filename, Count=count)
IF count EQ 0 THEN BEGIN
Widget_Control, event.top, Timer=5
Print, 'Still looking...
ENDIF ELSE Print, 'Found File: ', filename
END


PRO TestForFile, filename
tlb = Widget_Base(Map=0)
Widget_Control, tlb, /Realize, Set_UValue=filename
Widget_Control, tlb, Timer=5
XManager, 'testforfile', tlb, /No_Block
END
**************************************************

I ran it like this:

IDL> TestForFile, 'butter.pro'

Here is my output. Note, I had to save a file
named "butter.pro" to get the think stopped. :-)

Still looking...
Still looking...
Still looking...
Still looking...
Found File: butter.pro

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Way to determine big/little endian?
Next Topic: Re: Free-hand ROIs using DRAW_WIDGET

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

Current Time: Fri Oct 10 06:55:16 PDT 2025

Total time taken to generate the page: 0.15801 seconds