求救大神界面崩溃
void on_button_clicked(GtkWidget *button,gpointer userdata)//按钮事件{
cairo_t *cr;
cr = gdk_cairo_create (window);//想在窗体上画一条线
cairo_set_line_width (cr, 10);
cairo_move_to(cr,0,0);
cairo_line_to(cr,10, 10);
cairo_set_source_rgb(cr,0,1,0);
cairo_stroke(cr);
cairo_destroy(cr);
//return;
}
gdk_cairo_create的window你是用的什么?这里应该是GDKWindow不是GtkWindow哦~
页:
[1]