example-1-with-autoconnection.c

来自「Developing with Gnome一书examples例子代码」· C语言 代码 · 共 33 行

C
33
字号
/* This program displays a simple window and has a simple callback for * when the OK button is clicked. */#include <gtk/gtk.h>#include <glade/glade.h>voidok_button_clicked (GtkWidget *widget, gpointer user_data){  printf ("Thanks for trying out my program.\n");  gtk_main_quit ();}intmain (int argc, char *argv[]){  GladeXML *main_window;  gtk_init (&argc, &argv);  /* load the interface */  main_window = glade_xml_new ("example-1.glade", NULL, NULL);  /* connect the signals in the interface */  glade_xml_signal_autoconnect (main_window);  /* start the event loop */  gtk_main ();  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?