This is my first post and I am a complete (well
almost complete) noob at WxRuby. I have
programmed in Ruby for a while, but now I am
trying my hand at a GUI base program running on
Windows. There is quite a bit of serial
communication between the app and a external
device. The problem I am facing is a function call
that takes a long time to complete before
returning to WxRuby.
My application is pretty simple with a start
button, a few fields that display data and a
progress bar. There are a couple of dialogs that
pop up during the call as well. Advancing the
progress bar and displaying dialogs works just
fine, except the dialog windows do mess up the top
application appearance once the dialog is
dismissed. Of course once the function call is
complete the screen will refresh as expected.
I have tried setting a separate thread for the
function and using a timer with Thread.pass as
shown in the WxRuby thread example. Although the
GUI is nice an responsive, the performance of the
long running function is unacceptable.
So is there a callback that can be done to allow
the ruby app to run that I can make from this long
running function or some other way to use a
separate thread more efficiently.
Ruby 1.8.7, WxRuby 2.0.1
Any help is appreciated.