[fxruby-users] FXProgressBar slow update; FXDataTarget
ralphs at dos32.com
Fri Sep 24 08:56:23 EDT 2010
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.
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...
More information about the fxruby-users