Ralph Shnelvar
2010-Sep-24 12:56 UTC
[fxruby-users] FXProgressBar slow update; FXDataTarget
This is not a question but a mini-report on an issue (and solution) I had with FXProgressBar. I have some code that puts up an FXProgressBar and then uses FXDataTarget#value to update the amount of progress. I also have an FXLabel object and used FXLabel#text to update the label. The LABEL would change "instantly" but the FXProgressBar object being displayed was very far behind the FXLabel object being displayed. The FXProgress bar object reported on the percentage completion of a CPU intensive thread. I played with priorities. I played with having the CPU intensive thread go to sleep. Nothing worked. To make a long story short ... the problem is in the FXDataTarget. It appears (and this is by observation and not by code inspection) that FXDataTarget objects get updated somewhat like chores get executed. That is, the various objects "connected" to the instantiated FXDataTarget variable get updated "whenever." Indeed, I am guessing that all the synchronizations occur at SEL_UPDATE time. SEL_UPDATE on my machine gets triggered about once every 5 seconds rather that several times a second. Thus, the solution to my problem was to get rid of the FXDataTarget for the progress bar and do a direct assign to FXProgressBar#progress. Works like a champ. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100924/a96d087b/attachment.html>