//Hello World Program //V. 1.0 //Made by Erick Johnson in Minnesota //Another project by: Agroome Free #include //Function prototype for signal handler static gint window_closed(GtkWidget* w, GdkEentAny* e, gpointer data); int main(int argc, char* argv[]) { GtkWidget* window; //A window GtkWidget* label; //A label //Initialize GTK+ gtk_init(&argc, &argv); //Create new window window = gtk window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Hello World"); // Add some text! label = gtk_label_new("Hello, World! I hope to be doing a lot more programming under GNOME and GTK+"); gtk_container_add(GTK_CONTAINER(window), label); //Set up the event handler gtk_signel_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(window_closed), NULL); //Show the window and its widget gtk_widget_show_all(window); //Initiate the event loop gtk_main(); //Exit the program return 0; } //Event handler for window closed static gint window_closed(GtkWidget* w, GdkEventAnt* e, gpointer data) { //Terminate the event loop, then tell //GTK+ it's OK to delte the window gtk_main_quit(); return FALSE; }