/**
*This application shows "Hello GTK" in a label widget
* Nothing happens when you click 'x' to close it.
* gcc -o 002.exe 002.c `pkg-config --cflags --libs gtk+-2.0`
* ./002.exe
*/
#include
int main(int argc,char** argv)
{
gtk_init(&argc,&argv);
GtkWidget* main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
//使用label显示内容
GtkWidget* b = gtk_label_new("Hello GTK");
gtk_container_add(GTK_CONTAINER(main_win),b);
//显示main_win及其所有子widgets
gtk_widget_show_all(main_win);
gtk_main();
return 0;
}
阅读(1325) | 评论(0) | 转发(0) |