Re: [gtk-list] GTK 1.2 questions





On Sun, 06 Jun 1999 20:55:04 Ron Forrester wrote:
> 
> A few days ago I sat down to right my first GTK (indeed, my first GUI
> linux app). There are a few tasks I have been unable to figure out,
> and would really appreciate some help.
> 
 	none to get the width.
> 
> 3) In a signal handler for a button, I enter a loop and do some
> 	possibily time consuming task. I want to provide some feedback to
> 	the user on the progress. I have tried using both a progress bar
> 	and a status bar, but I had the same problem with both. In the
> 	loop, I attempt to update the status, but the widget never updates
> 	itself, until the signal handler leaves. I tried calling
> 	gtk_widget_realize(), and all that did was make the loop run much
> 	slower. I assume I am starving the message pump or something? Is
> 	there a right way to do this?
You should have to use this:

gtk_progress_set_value (...,...);
while (gtk_events_pending ())
 gtk_main_iteration ();

After that your progressbar should work as you aspected it. 
> That's a good start. 

Andreas Scherf
- "If you kiss me, I'll turn into a beautiful princess."
- "Look, I'm a computer programmer. I dont have time for girls,
but a talking frog is very very cool."
+--------------------------------------------+
I EMail    : scherfa@fh-trier.de             I  
I Homepage : http://www.fh-trier.de/~scherfa I
+--------------------------------------------+



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