GtkProgressBar getting blocked



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"
   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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]