From: Graham Stokes Date: 2006-11-13T19:31:21+09:00 Subject: Re: Why won't my FXRuby widgets update? Joel VanderWerf wrote: > I think your diagnosis is right. Your ruby code is never giving Fox a > chance to update the GUI. You can fix it by explicitly sharing time with > Fox: > > def procAll(sender, sel, ptr) > @stringVal.value += "This is new text\n" > 500.times do > getApp.runOneEvent > sleep 0.01 # or do some fraction of your processing > end > end > > There's still a little delay, but it's probably acceptable. > > You might want to do the runOneEvent calls in one ruby thread, and do > your non-GUI processing in another. > Joel, thanks a lot for pointing me in the right direction - this indeed turns out to be the problem and event processing in a separate thread is easy and elegant. How curious that none of the examples supplied pays any attention to this requirement. > In some cases, you really want "as soon as" semantics, and in those a > good alternative to FXDataTarget is my FoxTails lib. See > http://redshift.sourceforge.net/foxtails or search the fxruby-users list > archive. I will check this out to see the benefits. Thanks again. Best Regards, Graham -- Posted via http://www.ruby-forum.com/.