How do I redraw only portion of a GtkWidget

I want to redraw only part of a GtkTextView widget. I make sure that application-paintable flag for the widget is turned on and connect the draw signal handler.

I tried many things for example:

GdkRectangle rect;

gdk_cairo_get_clip_rectangle(cr, &rect);

cairo_surface_t* surface = cairo_get_target(cr);
cairo_surface_t* newsurf = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), rect.width - 50, rect.height);

cairo_set_source_surface(cr, newsurf, rect.x + 10, rect.y + 40);

except that nothing really happens. How do I re-draw only a rect of the dirty clip region in cr or how (as I am trying) to modify cr so that the surface area has different dimensions?

Maybe it will be helpful

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.