brain/viz.cc
/* Create a new surface of the appropriate size to store our scribbles */
Create a new surface of the appropriate size to store our scribbles
Create a new surface of the appropriate size to store our scribbles
static gboolean
configure_event_cb(GtkWidget         *widget,
                   GdkEventConfigure *event,
                   gpointer           data)
{
    guard _gg(mx);
    if (surface) {
        cairo_surface_destroy(surface);
    }
    surface = gdk_window_create_similar_surface(
        gtk_widget_get_window(widget),
        CAIRO_CONTENT_COLOR,
        gtk_widget_get_allocated_width(widget),
        gtk_widget_get_allocated_height(widget)
    );
    clear_surface();
    return TRUE;
}
static gboolean configure_event_cb ( GtkWidget * widget , GdkEventConfigure * event , gpointer data ) { guard _gg ( mx ) ; if ( surface ) { cairo_surface_destroy ( surface ) ; } surface = gdk_window_create_similar_surface ( gtk_widget_get_window ( widget ) , CAIRO_CONTENT_COLOR , gtk_widget_get_allocated_width ( widget ) , gtk_widget_get_allocated_height ( widget ) ) ; clear_surface ( ) ; return TRUE ; }
Create a new surface of the appropriate size to store our scribbles
Create a new surface of the appropriate size to store our scribbles
/* Initialize the surface to white */ /* We've handled the configure event, no need for further processing. */