Re: GdkPixmap and GtkDrawingarea



Hi,

Olexiy Avramchenko <ath beast stu cn ua> writes:

> You have to be sure that your widget (GtkDrawingArea) was realized.
> If not - all gdk stuff inside it is not allocated.
> The simpliest way is to call gtk_widget_show(area) after area creation
> (before all your drawlings).

Olexiy is right here when he says that the widget needs to be realized
before widget->window can be used. However gtk_widget_show() will not
realize a widget. There's gtk_widget_realize() which does this but I'd
suggest that, instead of using that, make sure all your drawing code
is only ever executed in the expose_event handler. This will make sure
that the widget has been realized and it will make your drawing
back-buffered and thus flicker-free. Actually it can be considered a
bug to draw anything outside an expose_event handler.


Salut, Sven



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