[maemo-commits] [maemo-commits] r18905 - in projects/haf/trunk/sapwood: . demos

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jul 20 16:59:28 EEST 2009
Author: herzi
Date: 2009-07-20 16:59:26 +0300 (Mon, 20 Jul 2009)
New Revision: 18905

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/demos/rgba-demo.c
Log:
2009-01-09  Sven Herzberg  <sven at imendio.com>

	Added a quit button to the window

	* demos/rgba-demo.c (main): added a quit button; set the table's row
	spacing; destroy the window when the button is clicked



Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2009-07-20 13:59:23 UTC (rev 18904)
+++ projects/haf/trunk/sapwood/ChangeLog	2009-07-20 13:59:26 UTC (rev 18905)
@@ -20,6 +20,13 @@
 
 2009-01-09  Sven Herzberg  <sven at imendio.com>
 
+	Added a quit button to the window
+
+	* demos/rgba-demo.c (main): added a quit button; set the table's row
+	spacing; destroy the window when the button is clicked
+
+2009-01-09  Sven Herzberg  <sven at imendio.com>
+
 	Added an entry to the window
 
 	* demos/rgba-demo.c (main): added a table and entry into the window

Modified: projects/haf/trunk/sapwood/demos/rgba-demo.c
===================================================================
--- projects/haf/trunk/sapwood/demos/rgba-demo.c	2009-07-20 13:59:23 UTC (rev 18904)
+++ projects/haf/trunk/sapwood/demos/rgba-demo.c	2009-07-20 13:59:26 UTC (rev 18905)
@@ -29,6 +29,7 @@
 main (int   argc,
       char**argv)
 {
+  GtkWidget* button;
   GtkWidget* entry;
   GtkWidget* table;
   GtkWidget* window;
@@ -38,17 +39,27 @@
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   table  = gtk_table_new (1, 2, FALSE);
   entry  = gtk_entry_new ();
+  button = gtk_button_new_from_stock (GTK_STOCK_QUIT);
 
   gtk_container_add (GTK_CONTAINER (window), table);
   gtk_table_attach  (GTK_TABLE (table), entry,
                      0, 1, 0, 1,
                      GTK_FILL, GTK_FILL,
                      0, 0);
+  gtk_table_attach  (GTK_TABLE (table), button,
+                     0, 1, 1, 2,
+                     GTK_FILL, GTK_FILL,
+                     0, 0);
 
   gtk_container_set_border_width (GTK_CONTAINER (window), 12);
   g_signal_connect (window, "destroy",
                     G_CALLBACK (gtk_main_quit), NULL);
 
+  gtk_table_set_row_spacings (GTK_TABLE (table), 12);
+
+  g_signal_connect_swapped (button, "clicked",
+                            G_CALLBACK (gtk_widget_destroy), window);
+
   gtk_widget_show_all (window);
 
   gtk_main ();

More information about the maemo-commits mailing list