这个程序更为简单,不使用任何子widget,直接将文本内容显示在window的标题上。
/**
*This application shows "Hello GTK" osn window title.
* Nothing happens when you click 'x' to close it.
* gcc -o 003.exe 003.c `pkg-config --cflags --libs gtk+-2.0`
* ./003.exe
*/
#include
int main(int argc,char** argv)
{
gtk_init(&argc,&argv);
GtkWidget* main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
//在Window标题上显示文本
gtk_window_set_title(GTK_WINDOW(main_win),"Hello GTK");
gtk_widget_show_all(main_win);
gtk_main();
return 0;
}
阅读(939) | 评论(0) | 转发(0) |