Re: Refreshing the GUI in a CPU intensive application
- From: "Meli Vázquez" <ribonucleico gmail com>
- To: gtk-list gnome org
- Subject: Re: Refreshing the GUI in a CPU intensive application
- Date: Tue, 28 Mar 2006 20:02:34 +0200
Thank you very much Paul :)
I've just tried it and It works.
.
On 3/28/06, Paul Davis <paul linuxaudiosystems com> wrote:
> On Tue, 2006-03-28 at 19:49 +0200, Meli Vázquez wrote:
> > Hi everyone.
> >
> > I'm working on an application which is CPU intensive. The GUI has
> > scrollable window where I print detailed information about
> > intermediate results while the application is running. The application
> > takes about 2 minutes to end.
> >
> > I don't know why the scrollable window doesn't update while it's running.
> >
> > Here is how I designed it:
> >
> > 1) When the user press 'return', the associated callback adds the so
> > called CPU intensive function to the idle queue with low priority (I
> > also tried to call it directly).
> >
> > 2) This CPU intensive function prints data into the scrollable window,
> > but I cannot see this information until the application ends. This CPU
> > intensive function consists basically of a huge loop and I tried
> > calling:
> > - gdk_window_process_all_updates ();
> > - gdk_window_process_updates(); and
> > - gtk_widget_queue_draw()
> > from time to time during the loop. Nothing of this solves my problem.
>
> The Answer That Crushed A Thousand FAQs:
>
> while (gtk_events_pending()) { gtk_main_iteration(); }
>
>
>
--
Amelio V.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]