I have read what I could about SEL_UPDATE and I understand that the block(s) that get called "from" SEL_UPDATE only get called when "there is no more work to do". I took the splitter.rb example that comes with FXRuby. I put in a "puts" in one of the SEL_UPDATE blocks and I get about 4 a second. Not awful ... but ... why is it so slow? In my code which is ... more or less ... similar to splitter.rb (just a lot more widgets and buttons) and a single SEL_UPDATE block with almost nothing in it ... and the block gets trigger once every four seconds rather than 4 times a second. That''s unacceptably slow. How can I tell what''s causing SEL _UPDATE to be so slow? (CPU usage is at 4%. I don''t think I''m in a heavy loop.) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100817/7d65f849/attachment.html>
I know this phenomenon. You have to forbid threads. There is a fxruby command for that. I forgot the exact syntax. Michel Demazure michel at demazure.com De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Ralph Shnelvar Envoy? : mercredi 18 ao?t 2010 00:29 ? : fxruby-users at rubyforge.org Objet : [fxruby-users] SEL_UPDATE not responsive I have read what I could about SEL_UPDATE and I understand that the block(s) that get called "from" SEL_UPDATE only get called when "there is no more work to do". I took the splitter.rb example that comes with FXRuby. I put in a "puts" in one of the SEL_UPDATE blocks and I get about 4 a second. Not awful ... but ... why is it so slow? In my code which is ... more or less ... similar to splitter.rb (just a lot more widgets and buttons) and a single SEL_UPDATE block with almost nothing in it ... and the block gets trigger once every four seconds rather than 4 times a second. That''s unacceptably slow. How can I tell what''s causing SEL _UPDATE to be so slow? (CPU usage is at 4%. I don''t think I''m in a heavy loop.) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100818/4e3a2605/attachment.html>
Ralph Shnelvar
2010-Aug-18 12:42 UTC
[fxruby-users] Fwd: RE: Re[2]: SEL_UPDATE not responsive
This is a forwarded message
From: Michel Demazure <michel at demazure.com>
To: "''Ralph Shnelvar''" <ralphs at dos32.com>
Date: Wednesday, August 18, 2010, 4:26:24 AM
Subject: [fxruby-users] SEL_UPDATE not responsive
===8<==============Original message text==============Yes, that?s the
command.
It solved my problems. Without it, for instance, the ?tips? took five seconds to
appear when hovering over buttons.
MD.
De : Ralph Shnelvar [mailto:ralphs at dos32.com]
Envoy? : mercredi 18 ao?t 2010 11:53
? : Michel Demazure
Objet : Re[2]: [fxruby-users] SEL_UPDATE not responsive
Michel,
I think the syntax is
FXApp#threadsEnabled=false
I have not tried this because, while waiting for an answer, I came up with a
workaround that I like.
Instead of using SEL_UPDATE, I create a
getApp().addTimeout(500, method(:timeoutHandler), :repeat => true)
.
.
.
def timeoutHandler(sender, sel, ptr)
#puts "#{__FILE__} @ #{__LINE__} #{Time.now}"
# do something ever .5 second
end
The "sender, sel, ptr" won''t be the same as in SEL_UPDATE,
but that is a minor inconvenience compared to the added flexibility. Plus,
converting the logic from SEL_UPDATE to a timeout handler was, for me, very easy
and straightforward.
Ralph
Wednesday, August 18, 2010, 3:24:34 AM, you wrote:
I know this phenomenon. You have to forbid threads. There is a fxruby command
for that. I forgot the exact syntax.
Michel Demazure
michel at demazure.com
De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at
rubyforge.org] De la part de Ralph Shnelvar
Envoy? : mercredi 18 ao?t 2010 00:29
? : fxruby-users at rubyforge.org
Objet : [fxruby-users] SEL_UPDATE not responsive
I have read what I could about SEL_UPDATE and I understand that the block(s)
that get called "from" SEL_UPDATE only get called when "there is
no more work to do".
I took the splitter.rb example that comes with FXRuby. I put in a
"puts" in one of the SEL_UPDATE blocks and I get about 4 a second.
Not awful ... but ... why is it so slow?
In my code which is ... more or less ... similar to splitter.rb (just a lot more
widgets and buttons) and a single SEL_UPDATE block with almost nothing in it ...
and the block gets trigger once every four seconds rather than 4 times a second.
That''s unacceptably slow.
How can I tell what''s causing SEL _UPDATE to be so slow? (CPU usage is
at 4%. I don''t think I''m in a heavy loop.)
--
Best regards,
Ralph mailto:ralphs at dos32.com
===8<===========End of original message text==========
--
Best regards,
Ralph mailto:ralphs at dos32.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20100818/6b48c270/attachment-0002.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20100818/6b48c270/attachment-0003.html>