Re: Question about callbacks and Gnome Appbar



On Thu, Feb 03, 2000 at 01:21:10PM -0600, David Haraburda wrote:
> This may be more GTK related, but what I am trying to do is after the
> user clicks OK on the GTK FileSelection widget, I am going to popen() a
> call to 'wc' to count how many lines are in the file... Since the files
> are ~ 500 mb I thought I would have the GtkPRogress on the appbar flash
> back and forth in activity mode while this happens. I was going to loop
> with select() watching wc for return and updating the GtkProgress. This
> is all happening in the callback for the FileSelection's OK Button
> click. The only problem is, is that it looks like none of my GTK calls
> are getting processed until the callback actually exits. I have taken
> out most of my real code and stuck in some sleep()'s and printf()'s. In
> this callback, I call gtk_widget_destroy to destroy the FileSelection --
> it doesn't actually disappear until my callback exits.  It doesn't
> update the GtkProgress either (when I able to see it, if the
> FileSelection isn't in the way).  Am I going at this the wrong way or
> are there some gtk calls I can make to manually "refresh" the app so
> stuff is re-drawn and updated?

You have to call gtk_main_iteration() every once in a while.  You should use
something like this I guess

while(gtk_events_pending())
	gtk_main_iteration();

That should process all the events that are pending.

George



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