PsppireScanf and PsppireAcr: Avoid deprected API features
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 21 Jun 2015 18:12:57 +0000 (20:12 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 21 Jun 2015 18:12:57 +0000 (20:12 +0200)
src/ui/gui/psppire-acr.c
src/ui/gui/psppire-acr.h
src/ui/gui/psppire-scanf.c
src/ui/gui/psppire-scanf.h

index fc89b822125a4c38ebfabbf62fa8e30c27dc545c..13b5803e5e2d1bc64beccdeced1f8fba58ed8163 100644 (file)
 #include "psppire-acr.h"
 #include "helper.h"
 
-G_DEFINE_TYPE (PsppireAcr, psppire_acr, GTK_TYPE_HBOX);
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+G_DEFINE_TYPE (PsppireAcr, psppire_acr, GTK_TYPE_BOX);
 
 static void
 psppire_acr_dispose (GObject *obj)
@@ -248,7 +252,6 @@ psppire_acr_set_enabled (PsppireAcr *acr, gboolean status)
                            && row_is_selected (acr));
 }
 
-
 static void
 psppire_acr_init (PsppireAcr *acr)
 {
@@ -256,11 +259,13 @@ psppire_acr_init (PsppireAcr *acr)
 
   GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL);
 
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (acr), GTK_ORIENTATION_HORIZONTAL);
+
   acr->tv = GTK_TREE_VIEW (gtk_tree_view_new ());
 
-  acr->add_button = gtk_button_new_from_stock (GTK_STOCK_ADD);
-  acr->change_button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
-  acr->remove_button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
+  acr->add_button = gtk_button_new_with_label (_("Add"));
+  acr->change_button = gtk_button_new_with_label (_("Edit"));
+  acr->remove_button = gtk_button_new_with_label (_("Remove"));
 
   acr->get_value = NULL;
   acr->get_value_data = NULL;
index b58385524a6308001e3e9f2036631c222e8024b7..73873df356ef2502dcfbdd07481d0b1609fa9a71 100644 (file)
@@ -64,7 +64,7 @@ typedef void (*UpdateCallbackFunc) (gpointer);
 
 struct _PsppireAcr
 {
-  GtkHBox parent;
+  GtkBox parent;
 
 
   GtkListStore *list_store;
@@ -90,7 +90,7 @@ struct _PsppireAcr
 
 struct _PsppireAcrClass
 {
-  GtkHBoxClass parent_class;
+  GtkBoxClass parent_class;
 };
 
 
index c2c8e55ade92df8cbf874e3733ad33c574ff73e0..52446b38922dadfab027ec8618e8ecebf3a3cda3 100644 (file)
@@ -29,7 +29,7 @@
 static void psppire_scanf_class_init          (PsppireScanfClass *class);
 static void psppire_scanf_init                (PsppireScanf      *w);
 
-G_DEFINE_TYPE (PsppireScanf, psppire_scanf, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (PsppireScanf, psppire_scanf, GTK_TYPE_BOX)
 
 /* Properties */
 enum
@@ -331,6 +331,7 @@ psppire_scanf_class_init (PsppireScanfClass *class)
 static void
 psppire_scanf_init (PsppireScanf *w)
 {
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (w), GTK_ORIENTATION_HORIZONTAL);
 }
 
 gchar
@@ -349,7 +350,7 @@ psppire_scanf_get_child (PsppireScanf *w, gint n)
 
 
 /*
-   This widget is a GtkHBox populated with GtkLabel and GtkEntry widgets.
+   This widget is a horizontal GtkBox populated with GtkLabel and GtkEntry widgets.
    Each conversion in FMT will cause a GtkEntry (possibly a GtkSpinButton) to
    be created.  Any text between conversions produces a GtkLabel.
    There should be N arguments following FMT should be of type GtkEntry **,
index a2ef479100ec03a3a87f59f019fc72b887ac986a..d81d54cc74e612c2aa996cc629b5cf685d44e7a7 100644 (file)
@@ -41,7 +41,7 @@ typedef struct _PsppireScanfClass  PsppireScanfClass;
 /* All members are private. */
 struct _PsppireScanf
 {
-  GtkHBox parent;
+  GtkBox parent;
   const gchar *format;
 
   GtkWidget **widgets;
@@ -56,7 +56,7 @@ struct _PsppireScanf
 
 struct _PsppireScanfClass
 {
-  GtkHBoxClass parent_class;
+  GtkBoxClass parent_class;
 };