On Thu, 2006-03-16 at 10:09 -0500, jim Pharis wrote:
> I have an external synchronous library call that takes a while to
> complete. I want to display a progress bar well I'm waiting.
> 
> The problem is, even when the progress bar is in the thread in a loop
> calling gtk_progress_bar_pulse, the progress bar still looks like its
> frozen. Here is the psuedo code.
> 
> ------------------begin psuedo code-----------------------
> global wait
> 
> progress_bar
>    create window and progress progress
>    show_all
>    while wait
>       gtk_progress_bar_pulse
>       print "updating progress bar"

This loop needs to run the main Gtk loop to make the updates visible. 
It might be wise - as suggested by Daniel - to fork off the call to the
library function. Otherwise you might get into threading issues with
Gtk.

Axel.

>    print "finished"
>    return
> 
> main
>    wait = TRUE
>   print "calling thread"
>    g_thread_create (progress_bar....
>    ret = call crypto func
>    print "call returned"
>    wait = FALSE
> ------------------end psuedo code-----------------------
> 
> The output looks like this
> 
> calling thread
> updating progress bar
> updating progress bar
> updating progress bar
> updating progress bar
> updating progress bar
> updating progress bar
> call returned
> finished
> 
> Yet the progress bar never updates in the loop, it stays frozen until
> it hits finished and then it pulses once. Whats my issue?
> 
> PS I tried making wait a mutex but that didn't seem to make any
> difference. I don't believe there's any problem with race conditions
> so I took it out for simplicity.
> 
> --
> - Jim Pharis
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
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