nuking GtkWidget::draw



Hi,

Those of you who've implemented widgets may have noticed the useless
"draw" virtual method, which always does the same thing as the
expose_event handler. draw is even more useless in GTK 2.0, because
drawing works by invalidating a region, which down the line results in
expose events. You almost always want to use region invalidation
instead of drawing immediately.

Owen's suggestion is to remove the "draw" virtual method, and
implement gtk_widget_draw() as "invalidate the given region, then
process the expose queue immediately before returning." So
gtk_widget_draw() will still cause an immediate draw, but using
expose_event, and the draw virtual method won't get called at all.

So I'll implement this soonish if people don't see a problem with
it. The impact on users will typically be to just delete the "draw"
method from their widget implementations.

Havoc




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