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

Home » Public Forums » archive » Re: Generating a widget 'event' from an external program...
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: Generating a widget 'event' from an external program... [message #64359] Thu, 18 December 2008 06:45
ghgm2008 is currently offline  ghgm2008
Messages: 17
Registered: December 2008
Junior Member
Allan,

That's great thanks - it's definitely the timer keyword that I am
wanting (ie, your second solution)....
I'll build it into my program and see if it works....

Cheers for now,

George.
Re: Generating a widget 'event' from an external program... [message #64364 is a reply to message #64359] Thu, 18 December 2008 03:27 Go to previous message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
George,

ghgm2008@gmail.com wrote:
> Hi there,
>
> I have a well developed widget program (which actually shows data
> projected on an Earth globe) and I am wanting the program to respond
> to a 'button push' generated by an external program. Specifically I
> want the program to update in real-time.
>
> I'm sure there are many ways of doing such a thing - but one way that
> would work for me right now would be if an external program (like a
> 'cron driven' perl script) could 'push' an idl widget button.
>

Look at X11::GUITest but it can get a bit messy to locate the window
etc. I tend to only use X11::GUITest to simulate the keyboard but I
think it can also simulate a mouse.

You could also look at signals but I've never done this with IDL so I
don't know how easy/possible it is.

> Is there any way of doing this ? If not (in the way I am imagining
> it) then the supplementary question is:
> How do you build a full widget program that will do all the usual
> widget things - but will also just naturally update itself every
> minute or so...
>

Look at the timer= keyword to widget_control.

As an example:

pro time_e,event
widget_control,event.top,get_uvalue=wid
widget_control,wid,set_value=systime()
widget_control,wid,timer=1 ; second
end

pro time_w
tlb=widget_base(title='Time')
label=widget_label(tlb,value=systime())
widget_control,tlb,/realize
widget_control,label,timer=1 ; second
widget_control,tlb,set_uvalue=label
xmanager,'time_w',tlb,event_handler='time_e'
end

Note in particular that you need to re-set the timer after it's
happened. Also, it's not necessary to associate the timer with the label
(typically it would be for the top widget_base), I was just being lazy.

Thanks,

Allan

> Thanks for any help....
>
> George.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Remotely running IDL on a Mac using X11
Next Topic: Re: more log-scaled images

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

Current Time: Wed Oct 08 15:48:56 PDT 2025

Total time taken to generate the page: 0.08622 seconds