Re: Getting a GDK_CONFIGURE event from a GtkImage



On Tue, Jun 26, 2007 at 02:28:09PM -0600, Jim George wrote:
can't you just compare the
new allocation to the current one and do nothing when they
are equal?

That doesn't work, they seem to always be equal. I'm comparing the
allocation being passed to the alloc-event handler in the second
parameter and the allocation of the widget itself using something like
GTK_WIDGET(object)->allocation.width. Seems like alloc-event gets
called after the widget is allocated space, so that's the correct
behaviour.

I see, the widget's handler runs first.

Anyway, by current one I meant more something like the
last one used.  If the widget already has stored the new
allocation, you can always keep your own copy of the
GtkAllocation elsewhere for comparison.

Or just subclass GtkWidget and get your own size-allocate,
the widget implementation seems to be trivial here
(boilerplate code plus one gdk_draw_pixbuf() in
"expose-event").

Yeti

--
http://gwyddion.net/



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