Re: [gtkmm] Forcing redraw of window, without returning to main event loop



>
>Hi,
>
>Is there a way in gtkmm to force a redraw of a window without returning to
>the main event loop?
>
>I have code which does a series of calculations, and I would like it to show
>intermediate calculations on the screen as it runs.  I am updating the
>models (eg ListStores) as the calculations are proceeding, but at present
>all the results are displayed only when the series of calculations is
>finished and control returns to gtkmm.  (I understand why it is doing this -
>I just wonder if there's a way to force a redraw).

it can be done, but on the gtk-list there was some discussion that
suggests that for the TreeView code this is a bad idea. ymmv.

	 gtk_main_iteration()

can be called anywhere, and will cycle through the update part of
GTK+'s event loop once. do not use:

       while (gtk_events_pending()) {
          gtk_main_iteration();
       }

since this probably won't work: the conditional looks for new
user-driven events (e.g. from X), not for queued redraw requests.

--p



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