# HG changeset patch # User Christophe Lincoln # Date 1303999717 -7200 # Node ID c179925b46d574167beafa0ec9c191c276850a80 # Parent acf34ef74c4b2f5f30eec93b620fe68135ec9ca7 en: have a C/GTK example with a callback diff -r acf34ef74c4b -r c179925b46d5 en/devel/forge.php --- a/en/devel/forge.php Thu Apr 28 15:43:10 2011 +0200 +++ b/en/devel/forge.php Thu Apr 28 16:08:37 2011 +0200 @@ -208,20 +208,23 @@ But keep in mind ther are not so popular than C and GTK and finaly not realy easier to learn and use, at least for simple fronted you finally use SHell scripts to perform tasks. Use can use Vala if you like but look at a pure - GTK single window, it only 12 lines: + GTK single window, it only 14 lines:

 #include >gtk/gtk.h<
 
 int main(int argc, char *argv[])
 {
-  GtkWidget *window;
-  
-  gtk_init(&argc, &argv);
-  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  gtk_widget_show(window);
-  gtk_main();
-  return 0;
+	GtkWidget *window;
+	
+	gtk_init(&argc, &argv);
+	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	g_signal_connect (G_OBJECT (window), "destroy",
+			G_CALLBACK (gtk_main_quit), NULL);
+	
+	gtk_widget_show(window);
+	gtk_main();
+	return 0;
 }