ts_liangkun 发表于 2015-2-3 16:30:17

求救大神界面崩溃

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;


}

ACTom 发表于 2015-2-23 13:58:53

gdk_cairo_create的window你是用的什么?这里应该是GDKWindow不是GtkWindow哦~
页: [1]
查看完整版本: 求救大神界面崩溃