Best way of dealing with progressbars

Hi!

What’s the best way of dealing with progressbars? I am currently
using a Gtk.idle_add function for updating a progressbar from a
different thread. It doesn’t run very well. I was wondering if
anyone has a better solution to this.

Nikolai W. wrote in post #1028602:

Hi!

What’s the best way of dealing with progressbars? I am currently
using a Gtk.idle_add function for updating a progressbar from a
different thread. It doesn’t run very well. I was wondering if
anyone has a better solution to this.

AFAIK, it’s the best way.

Do you have an example to take a look at ?

Simon

On Wed, Oct 26, 2011 at 16:18, Simon A.
[email protected] wrote:

Nikolai W. wrote in post #1028602:

What’s the best way of dealing with progressbars? I am currently
using a Gtk.idle_add function for updating a progressbar from a
different thread. It doesn’t run very well. I was wondering if
anyone has a better solution to this.

AFAIK, it’s the best way.

Do you have an example to take a look at ?

No, not really. It’s an internal thing. My problem is that the
progress tends not to be reported very well. Oh, well, fuck it.

On 26 October 2011 14:41, Nikolai W. [email protected] wrote:

Hi!

What’s the best way of dealing with progressbars? I am currently
using a Gtk.idle_add function for updating a progressbar from a
different thread. It doesn’t run very well. I was wondering if
anyone has a better solution to this.

I tend to prefer either a timeout in the main thread that polls, or an
IO source that listens for events (either via a pipe or socket from an
external process). It makes it easier to throttle progress events if
there are too many & helps maintain a separation between the
processing code and UI implementation.

(But I also generally prefer to do all my heavy lifting in helper
scripts, rather than the GUI)

When you say it doesn’t run well, do you mean that the process is
generally unresponsive or that there’s a lag between the progressbar
update being scheduled and being drawn?

Random Musing - http://www.frafferz.com/
Geek Blog - http://geoffyoungs.github.com/

On Thu, Oct 27, 2011 at 11:22, Simon A.
[email protected] wrote:

Nikolai W. wrote in post #1028759:

No, not really. It’s an internal thing. My problem is that the
progress tends not to be reported very well. Oh, well, fuck it.

I tested the attached program on 1.8.7 and 1.9.2, and it works without
problem.

Do you call external commands in your thread ?

I don’t mean that it doesn’t work, I just mean that it’s slow. The
progress being monitored is mostly other Ruby code, that is slightly
computation intense, but also COM activity through WIN32OLE.

Nikolai W. wrote in post #1028759:

No, not really. It’s an internal thing. My problem is that the
progress tends not to be reported very well. Oh, well, fuck it.

I tested the attached program on 1.8.7 and 1.9.2, and it works without
problem.

Do you call external commands in your thread ?

Simon