]> Pileus Git - ~andy/gtk/commitdiff
enable GTK_DISABLE_DEPRECATED again, (set_interp_type), (main): port over
authorKristian Rietveld <kris@gtk.org>
Mon, 13 Oct 2003 18:15:10 +0000 (18:15 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Mon, 13 Oct 2003 18:15:10 +0000 (18:15 +0000)
Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>

* demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
(set_interp_type), (main): port over from option menu to GtkComboBox.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
demos/testpixbuf-scale.c

index 1bd21dc5188a4330e38cf54c6a000ccc6122e481..b116a1a3bef9afe1b2a50a78d7a9eadb6f40b559 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
+       (set_interp_type), (main): port over from option menu to GtkComboBox.
+
 Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testmenus.c: Still uses option menus, so turn off
index 1bd21dc5188a4330e38cf54c6a000ccc6122e481..b116a1a3bef9afe1b2a50a78d7a9eadb6f40b559 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
+       (set_interp_type), (main): port over from option menu to GtkComboBox.
+
 Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testmenus.c: Still uses option menus, so turn off
index 1bd21dc5188a4330e38cf54c6a000ccc6122e481..b116a1a3bef9afe1b2a50a78d7a9eadb6f40b559 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
+       (set_interp_type), (main): port over from option menu to GtkComboBox.
+
 Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testmenus.c: Still uses option menus, so turn off
index 1bd21dc5188a4330e38cf54c6a000ccc6122e481..b116a1a3bef9afe1b2a50a78d7a9eadb6f40b559 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
+       (set_interp_type), (main): port over from option menu to GtkComboBox.
+
 Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testmenus.c: Still uses option menus, so turn off
index 1bd21dc5188a4330e38cf54c6a000ccc6122e481..b116a1a3bef9afe1b2a50a78d7a9eadb6f40b559 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 13 20:21:55 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again,
+       (set_interp_type), (main): port over from option menu to GtkComboBox.
+
 Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>
 
        * tests/testmenus.c: Still uses option menus, so turn off
index 6a90f0b0955f597e252e335e679f481b8f8a64bb..c54c4b25499b7379174132fce41602b2cd17bca3 100644 (file)
@@ -1,4 +1,3 @@
-#undef GTK_DISABLE_DEPRECATED
 #include <gtk/gtk.h>
 
 #include <stdio.h>
@@ -12,7 +11,12 @@ GtkWidget *darea;
 void
 set_interp_type (GtkWidget *widget, gpointer data)
 {
-  interp_type = GPOINTER_TO_UINT (data);
+  guint types[] = { GDK_INTERP_NEAREST,
+                    GDK_INTERP_BILINEAR,
+                    GDK_INTERP_TILES,
+                    GDK_INTERP_HYPER };
+
+  interp_type = types[gtk_combo_box_get_active (GTK_COMBO_BOX (widget))];
   gtk_widget_queue_draw (darea);
 }
 
@@ -59,7 +63,7 @@ int
 main(int argc, char **argv)
 {
        GtkWidget *window, *vbox;
-       GtkWidget *menuitem, *optionmenu, *menu;
+        GtkWidget *combo_box;
        GtkWidget *alignment;
        GtkWidget *hbox, *label, *hscale;
        GtkAdjustment *adjustment;
@@ -96,37 +100,18 @@ main(int argc, char **argv)
        vbox = gtk_vbox_new (FALSE, 0);
        gtk_container_add (GTK_CONTAINER (window), vbox);
 
-       menu = gtk_menu_new ();
-       
-       menuitem = gtk_menu_item_new_with_label ("NEAREST");
-       g_signal_connect (menuitem, "activate",
-                         G_CALLBACK (set_interp_type),
-                         GUINT_TO_POINTER (GDK_INTERP_NEAREST));
-       gtk_widget_show (menuitem);
-       gtk_container_add (GTK_CONTAINER (menu), menuitem);
-       
-       menuitem = gtk_menu_item_new_with_label ("BILINEAR");
-       g_signal_connect (menuitem, "activate",
-                         G_CALLBACK (set_interp_type),
-                         GUINT_TO_POINTER (GDK_INTERP_BILINEAR));
-       gtk_widget_show (menuitem);
-       gtk_container_add (GTK_CONTAINER (menu), menuitem);
-       
-       menuitem = gtk_menu_item_new_with_label ("TILES");
-       g_signal_connect (menuitem, "activate",
-                         G_CALLBACK (set_interp_type),
-                         GUINT_TO_POINTER (GDK_INTERP_TILES));
-       gtk_container_add (GTK_CONTAINER (menu), menuitem);
-
-       menuitem = gtk_menu_item_new_with_label ("HYPER");
-       g_signal_connect (menuitem, "activate",
-                         G_CALLBACK (set_interp_type),
-                         GUINT_TO_POINTER (GDK_INTERP_HYPER));
-       gtk_container_add (GTK_CONTAINER (menu), menuitem);
-
-       optionmenu = gtk_option_menu_new ();
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu);
-       gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 1);
+        combo_box = gtk_combo_box_new_text ();
+
+        gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "NEAREST");
+        gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "BILINEAR");
+        gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "TILES");
+        gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "HYPER");
+
+        gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 1);
+
+        g_signal_connect (combo_box, "changed",
+                          G_CALLBACK (set_interp_type),
+                          NULL);
        
        alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.5);
        gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
@@ -145,7 +130,7 @@ main(int argc, char **argv)
        gtk_scale_set_digits (GTK_SCALE (hscale), 0);
        gtk_box_pack_start (GTK_BOX (hbox), hscale, TRUE, TRUE, 0);
 
-       gtk_container_add (GTK_CONTAINER (alignment), optionmenu);
+       gtk_container_add (GTK_CONTAINER (alignment), combo_box);
        gtk_widget_show_all (vbox);
 
        /* Compute the size without the drawing area, so we know how big to make the default size */