Re: Can Timer interrupt widget callbacks? [message #90700 is a reply to message #90699] |
Sun, 29 March 2015 12:50   |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
On Sunday, March 29, 2015 at 2:58:36 PM UTC-4, Helder wrote:
> On Sunday, March 29, 2015 at 2:45:33 PM UTC+2, David Grier wrote:
>> Dear Folks,
>>
>> A change in the behavior of Timer callbacks from IDL 8.3 to IDL 8.4 has broken one of my
>> applications, and I could use some help in fixing it.
>>
>> Under IDL 8.3, the firing of an asynchronous Timer preempts widget callbacks.
>> This behavior appears to have been reversed in IDL 8.4, so that callbacks now take precedence.
>>
>> Here's the issue ...
>>
>> My application has a widget_draw object that is supposed to update at regular intervals while
>> the user drags graphics objects across the screen. I'm using Timer events to trigger the updates.
>> Under IDL 8.3, the widget_draw's animation is smooth. Under IDL 8.4, the animation stops
>> updating during drag events, which defeats the purpose of the animation.
>>
>> Is there any way to restore the old behavior so that firing a Timer interrupts a widget
>> callback, perhaps as an option to Timer::Set()?
>>
>> If there's no way to make the Timer "dominant", does anyone have suggestions for modifying
>> my widget callbacks so that they can check for pending timer events and handle them?
>>
>> All the best,
>>
>> David
>
> Hi David,
> not sure if this is what you are looking for... could it be: !DEBUG_PROCESS_EVENTS = 0
>
> From the IDL help (http://www.exelisvis.com/docs/Whats_New_8_3.html):
> Event handling while debugging
> In the past, IDL would not sent widget events when you were stopped within a routine. Now, by default, IDL sends widget events even when stopped within a routine. This allows you to use graphics and widget applications while debugging.
> There is a new system variable, !DEBUG_PROCESS_EVENTS, that can be set to 0 to disable this behavior, or to 1 to enable this behavior. The default value is 1.
>
> I hope it helps.
>
> Cheers,
> Helder
Hi Helder,
This is a great idea, but not apparently what's going on in my program. I tried setting
!DEBUG_PROCESS_EVENTS = 0
but did not see any change in performance. Under IDL 8.3 the program displays the animation
smoothly, and under IDL 8.4, the animation pauses during drag events. This makes sense
because !DEBUG_PROCESS_EVENTS was introduced in IDL 8.3 (where my program works)
and does not seem to have changed in IDL 8.4 (where it doesn't).
I'm guessing that the difference I'm seeing is due to a change in the behavior of asynchronous
timer events because there's a notation to that effect in the Version History of the documentation
for Timer.
Even so, knowing about !DEBUG_PROCESS_EVENTS will be very useful for building widget programs
in the future -- thanks for the pointer!
All the best,
David
|
|
|