gtk3
Question: how do I get the first argument for gdk_window_invalidate_rect from my GtkDrawingArea*widget in gtk3?
This is my "button-press" callback. Eventually clicking a button will make a change requiring redraw, which I'd like to handle in my "draw" signal callback. The manuals say I can trigger the draw signal by invalidating a region. The gdk_window_invalidate_rect says it's a wrapper around the region invalidator, and furthermore says I can pass NULL as second argument. The drawing is simple, redrawing the whole window will be quick.
Code:
/*the widget is a GtkDrawingArea*/
static gboolean button_press_event(GtkWidget*widget,const GdkEvent*event,gpointer data) {
gdouble x_win, y_win;
if (!gdk_event_get_coords(event,&x_win,&y_win))
puts("BUTTON, gdk_event_get_coords(event,&x_win,&y_win)) failed");
else
printf("x_win=%g y_win=%g\n",(double)x_win,(double)y_win);
gdk_window_invalidate_rect(widget,(const GdkRectangle *)NULL,TRUE);
return TRUE;
}