TA的每日心情![](source/plugin/dsu_paulsign/img/emot/fd.gif) | 奋斗 2015-10-16 12:17 |
---|
签到天数: 401 天 连续签到: 1 天 [LV.9]以坛为家II
|
发表于 2013-8-27 00:54:56
|
显示全部楼层
给个示例给你吧:
- #include<gtk/gtk.h>
- int main(int argc,char*argv[])
- {
- GtkWidget *window;
- GtkWidget *button;
- gtk_init(&argc,&argv);
- window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
- button=gtk_image_menu_item_new_from_stock(GTK_STOCK_OK,NULL);
- g_signal_connect(window,"destroy",G_CALLBACK(gtk_main_quit),NULL);
- gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
- gtk_container_add(GTK_CONTAINER(window),button);
- //gtk_window_set_default_size(GTK_WINDOW(window),320,240);
- gtk_widget_show_all(window);
- gtk_main();
- return 0;
- }
复制代码 GTK_STOCK_OK就是确定,你可以在gtkstock.h文件里面找到相关的定义
|
|