TA的每日心情 | 奋斗 2016-10-11 09:20 |
---|
签到天数: 271 天 连续签到: 1 天 [LV.8]以坛为家I
|
楼主 |
发表于 2012-1-24 23:42:23
|
显示全部楼层
刚用这个静态库编译了一个测试文件,代码如下:- #include <gtk/gtk.h>
- void ok (GtkWidget *widget, gpointer data)
- {
- gtk_main_quit ();
- }
- gint quit (GtkWidget *widget, GdkEvent *event, gpointer data)
- {
- gtk_main_quit ();
- return FALSE;
- }
- int main (int argc, char *argv[])
- {
- GtkWidget *window;
- GtkWidget *button;
- GtkWidget *label;
- GtkWidget *box;
- gtk_init (&argc, &argv);
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_container_set_border_width (GTK_CONTAINER (window), 10);
- g_signal_connect (G_OBJECT (window), "delete_event",
- G_CALLBACK (quit), NULL);
- button = gtk_button_new_with_label ("OK");
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (ok), NULL);
- label = gtk_label_new ("Hello, world!");
- //GTK_LABEL(label)->text = "HELLO";
- box = gtk_vbox_new (FALSE, 10);
- gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
- gtk_widget_show (label);
- gtk_widget_show (button);
- gtk_widget_show (box);
- gtk_container_add (GTK_CONTAINER (window), box);
- gtk_widget_show (window);
- gtk_main ();
- return 0;
- }
复制代码 编译后文件25M,经过strip和upx后2.7M,附上upx后的exe供大家测试。
我用wine运行后没有问题。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?马上加入
x
|