[fxruby-users] FXDataTarget & widget value update delay

Björn Bergqvist bjorn.bergqvist at gmail.com
Fri Oct 9 13:58:01 EDT 2009

this was an old thread but I noticed a significant speedup with
Ruby version 1.9.1p243, fxruby (1.6.19), Linux 32-bit (ArchLinux).


Björn Bergqvist

2006/10/3 Lyle Johnson <lyle at knology.net>:
> On Oct 3, 2006, at 10:34 AM, Philippe Lang wrote:
>> When assigning a new value to an FXDataTarget programmatically, it
>> takes a certain time for the widget linked to this FXDataTarget to
>> be updated, just as if there was some sort of "polling" inside the
>> framework. Delay can be as long as 1 second sometimes. Why aren't
>> the widgets updated straight away?
> The update of a widget's settings due to a change in a data target's
> value is handled by FOX's GUI update mechanism, described here:
>        http://www.fox-toolkit.org/guiupdate.html
> This process only kicks in during idle time in the GUI, so there's
> inevitably going to be some small delay. The problem is compounded in
> FXRuby due to the overhead required for converting back and forth
> between C++ objects and Ruby objects, as well as scheduling Ruby
> threads. If your FXRuby application doesn't use any threads, you can
> try turning off FXRuby's support for scheduling Ruby threads by
> calling the FXApp's disableThreads() method:
>        app.disableThreads
> Yet another option, but one which sort-of defeats the purpose of the
> GUI update process, is to call forceRefresh() directly whenever you
> make a change to the data target's value, e.g.
>        datatarget.value = "Foo"
>        app.forceRefresh
> Calling forceRefresh() causes the application to immediately start
> the GUI update process without waiting for idle time.
> Hope this helps,
> Lyle
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users

More information about the fxruby-users mailing list