Warning: begin_paint_region is deprecated since 3.22.
Indicates that you are beginning the process of redrawing region
.
Use begin_draw_frame instead
A backing store (offscreen buffer) large enough to contain region
will be created. The backing store will be initialized
with the background color or background surface for this. Then, all drawing operations performed on
this will be diverted to the backing store. When you call
end_paint, the backing store will be copied to this
, making it visible onscreen. Only the part of this contained in region
will be
modified; that is, drawing operations are clipped to region
.
The net result of all this is to remove flicker, because the user sees the finished product appear all at once when you call end_paint. If you draw to this directly without calling begin_paint_region, the user may see flicker as individual drawing operations are performed in sequence. The clipping and background-initializing features of begin_paint_region are conveniences for the programmer, so you can avoid doing that work yourself.
When using GTK+, the widget system automatically places calls to begin_paint_region and
end_paint around emissions of the expose_event signal. That is, if you’re writing
an expose event handler, you can assume that the exposed area in EventExpose has already
been cleared to the window background, is already set as the clip region, and already has a backing store. Therefore in most cases,
application code need not call begin_paint_region. (You can disable the automatic calls around expose events
on a widget-by-widget basis by calling gtk_widget_set_double_buffered
.)
If you call this function multiple times before calling the matching end_paint, the backing stores are pushed onto a stack. end_paint copies the topmost backing store onscreen, subtracts the topmost region from all other regions in the stack, and pops the stack. All drawing operations affect only the topmost backing store in the stack. One matching call to end_paint is required for each call to begin_paint_region.
this |
a Window |
region |
region you intend to draw to |