Hi,

try calling gtk's main processing routine while your task is doing
its work. Something like

     while(gtk_events_pending ())
        gtk_main_iteration ();

right after your update of the state of the progress bar should do the trick.

Till

Am Mittwoch 09 April 2008 schrieb Garth's KidStuff:
> Hi All,
> 
> I'm converting a large Windows/Mac project to run on Ubuntu, and I'm a
> little stuck when trying to use a ProgressBar.  We have a cross-platform
> class that assumes I can create a "Progress Monitor" dialog during
> time-intensive tasks, and then periodically update the progress as the task
> completes.
> 
> The problem that I'm having with using Gtk::ProgressBar seems to be a
> fundemental one about when dialogs can actually appear in the main window.
> For example, what I'd like to do is something along the lines of:
> 
> [in my main thread]
> ...
> Start a complex task
> Create a Progress Monitor dialog and show it
> Update the dialog as the task progresses
> Destroy the dialog
> ....
> 
> When I try this, nothing shows up *grin*.  As far as I can tell, I need to
> let the run loop process so that the dialog can be shown. (i.e. if I omit
> the "destroy" step in the above, I see the dialog as soon as I drop out of
> "my" code in the main thread, but that's too late -- the task is already
> completed)
> 
> One way to solve this is, of course, to rewrite all the places that use the
> Progress Monitor so that the work is done in a thread and the main thread
> can just be showing the progress bar.  I'd hesitate to try that with this
> code base because of the number of places in cross-platform code that would
> have to be rewritten.
> 
> Do any of you have any thoughts?
> 
> Thanks in advance!
> 


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to