Re: Gtkmm widgets don't always update...



On Thu, 2008-01-17 at 08:24 -0800, rob wrote:
> The call to gdk_flush() was an after-the-fact attempt at seeing if it 
> would make any difference; it did not.  Although I am quite
> familiar with the internals of X, I have yet to go through the Gtk / Gdk 
> code to learn its internals.  Perhaps I should at this point.

the usual approach to what you are trying to do is to use g_idle_add(),
which is thread safe, to queue up a function that will run in the
context of the sole GUI-controlling thread. that function can call
invalidate_rect(), and very soon after it, the normal update process
will take place and the GdkWindow involved will be redrawn.

most people doing multi-threaded programming with GTK (and more
generally with X11) have concluded that its better to have a single
thread making *all* GTK/GDK calls.

btw, i wasn't trying to be condescending with my earlier response. it
took me years to get to a place where i finally needed to understand how
the redraw process works in GTK, and now that i do understand it, it has
changed my perspective on some of my design approaches.

--p




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