标题:glade3 和gtk+3.0 联系不上,求助!!!
只看楼主
staofmilqua
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2014-6-30
 问题点数:0 回复次数:1 
glade3 和gtk+3.0 联系不上,求助!!!

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{

GtkBuilder *builder;
GtkWidget *window;

gtk_init(&argc, &argv);

builder = gtk_builder_new();

if ( !gtk_builder_add_from_file(builder,"/homework/abitno.glade", NULL)) {
        printf("connot load file!");
    }

gtk_builder_add_from_file (builder, "/homework/abitno.glade", NULL);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL); //实例化
window = GTK_WIDGET(gtk_builder_get_object (builder, "homework"));

g_object_unref(G_OBJECT(builder));

gtk_widget_show_all(window);

gtk_main();

return 0;
}


编译时通过。
运行时出错。
gtk_widget_show_all:assertion ‘GTK_IS_WIDGET (widget)’ failed
搜索更多相关主题的帖子: gtk 联系 int builder window 
2018-12-03 14:40
staofmilqua
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2014-6-30
得分:0 
没有高手回答吗?看来用不了glade了!只有放弃了。
2018-12-04 12:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-491786-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.260348 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved