From: John Darrington Date: Wed, 24 Jun 2015 19:03:07 +0000 (+0200) Subject: Replace some obsolete Gtk2 functions X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e0d0fdf07ad9b9b2790630ff3f9a458919735f;p=pspp Replace some obsolete Gtk2 functions --- diff --git a/src/ui/gui/include/gtk/gtk.in.h b/src/ui/gui/include/gtk/gtk.in.h index f1908befec..18ea7c0692 100644 --- a/src/ui/gui/include/gtk/gtk.in.h +++ b/src/ui/gui/include/gtk/gtk.in.h @@ -33,15 +33,6 @@ /* Like GSEAL but only used in PSPP */ #define PSEAL(X) X -#define gtk_hbox_new(HOMOGENOUS,SPACING) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, SPACING) -#define gtk_vbox_new(HOMOGENOUS,SPACING) gtk_box_new (GTK_ORIENTATION_VERTICAL, SPACING) - -#define gtk_vbutton_box_new() gtk_button_box_new (GTK_ORIENTATION_VERTICAL) -#define gtk_hbutton_box_new() gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL) - -#define gtk_vpaned_new() gtk_paned_new (GTK_ORIENTATION_VERTICAL) -#define gtk_hpaned_new() gtk_paned_new (GTK_ORIENTATION_HORIZONTAL) - #if (GTK_CHECK_VERSION(3,8,0) == 0) #define gtk_widget_register_window(widget, window) gdk_window_set_user_data (window, widget); #endif diff --git a/src/ui/gui/pspp-sheet-view-column.c b/src/ui/gui/pspp-sheet-view-column.c index 8dab5b5482..06b4a20287 100644 --- a/src/ui/gui/pspp-sheet-view-column.c +++ b/src/ui/gui/pspp-sheet-view-column.c @@ -1046,7 +1046,7 @@ pspp_sheet_view_column_create_button (PsppSheetViewColumn *tree_column) tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0, 0.0); - hbox = gtk_hbox_new (FALSE, 2); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); tree_column->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN); if (tree_column->child) diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 11b32b8f65..641b77bd57 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -8554,7 +8554,7 @@ pspp_sheet_view_ensure_interactive_directory (PsppSheetView *tree_view) gtk_widget_show (frame); gtk_container_add (GTK_CONTAINER (tree_view->priv->search_window), frame); - vbox = gtk_vbox_new (FALSE, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); diff --git a/src/ui/gui/psppire-acr.c b/src/ui/gui/psppire-acr.c index 13b5803e5e..a2ee6af559 100644 --- a/src/ui/gui/psppire-acr.c +++ b/src/ui/gui/psppire-acr.c @@ -255,7 +255,7 @@ psppire_acr_set_enabled (PsppireAcr *acr, gboolean status) static void psppire_acr_init (PsppireAcr *acr) { - GtkWidget *bb = gtk_vbutton_box_new (); + GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL); diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 08c72e890c..9f014e6b9d 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -717,7 +717,7 @@ psppire_data_editor_init (PsppireDataEditor *de) g_signal_connect (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (de->datum_entry))), "activate", G_CALLBACK (on_datum_entry_activate), de); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (hbox), de->cell_ref_label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), de->datum_entry, TRUE, TRUE, 0); @@ -725,7 +725,7 @@ psppire_data_editor_init (PsppireDataEditor *de) de->datasheet_vbox_widget = make_single_datasheet (de, GTK_TREE_VIEW_GRID_LINES_BOTH, FALSE); - de->vbox = gtk_vbox_new (FALSE, 0); + de->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start (GTK_BOX (de->vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (de->vbox), de->datasheet_vbox_widget, TRUE, TRUE, 0); diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index ae200940a7..f81d2fe6e6 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -552,7 +552,7 @@ data_pick_filename (PsppireWindow *window) gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo_box), cell, "text", 1); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), combo_box, FALSE, FALSE, 0); gtk_widget_show_all (hbox); @@ -936,7 +936,7 @@ psppire_data_window_finish_init (PsppireDataWindow *de, GtkWidget *hb ; GtkWidget *sb ; - GtkWidget *box = gtk_vbox_new (FALSE, 0); + GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); de->dataset = ds; de->dict = psppire_dict_new_from_dict (dataset_dict (ds)); diff --git a/src/ui/gui/psppire-dialog-action-paired.c b/src/ui/gui/psppire-dialog-action-paired.c index fbd09b97c4..c6e9612dd2 100644 --- a/src/ui/gui/psppire-dialog-action-paired.c +++ b/src/ui/gui/psppire-dialog-action-paired.c @@ -157,7 +157,7 @@ psppire_dialog_action_paired_activate (GtkAction *a) GtkBuilder *xml = builder_new ("paired-samples.ui"); GtkWidget *selector = get_widget_assert (xml, "psppire-selector3"); - GtkWidget *bb = gtk_hbutton_box_new (); + GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); GtkWidget *button = gtk_button_new_with_mnemonic (_("O_ptions...")); GtkWidget *box = get_widget_assert (xml, "vbox3"); diff --git a/src/ui/gui/psppire-dialog-action-two-sample.c b/src/ui/gui/psppire-dialog-action-two-sample.c index 0dd8d65048..beab3ab634 100644 --- a/src/ui/gui/psppire-dialog-action-two-sample.c +++ b/src/ui/gui/psppire-dialog-action-two-sample.c @@ -188,7 +188,7 @@ psppire_dialog_action_two_sample_activate (GtkAction *a) { /* NPAR Specific options */ GtkWidget *frame = gtk_frame_new (_("Test Type")); - GtkWidget *bb = gtk_vbutton_box_new (); + GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); GtkWidget *box = get_widget_assert (xml, "vbox3"); diff --git a/src/ui/gui/psppire-encoding-selector.c b/src/ui/gui/psppire-encoding-selector.c index 42fbea44e6..82677d8f59 100644 --- a/src/ui/gui/psppire-encoding-selector.c +++ b/src/ui/gui/psppire-encoding-selector.c @@ -173,7 +173,7 @@ psppire_encoding_selector_new (const char *default_encoding, renderer, set_sensitive, NULL, NULL); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("Character Encoding: ")), FALSE, FALSE, 0); diff --git a/src/ui/gui/psppire-means-layer.c b/src/ui/gui/psppire-means-layer.c index cde00d04df..f1ed2e245f 100644 --- a/src/ui/gui/psppire-means-layer.c +++ b/src/ui/gui/psppire-means-layer.c @@ -159,8 +159,8 @@ psppire_means_layer_clear (PsppireMeansLayer *ml) static void psppire_means_layer_init (PsppireMeansLayer *ml) { - GtkWidget *hbox_upper = gtk_hbox_new (FALSE, 5); - GtkWidget *hbox_lower = gtk_hbox_new (FALSE, 5); + GtkWidget *hbox_upper = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); + GtkWidget *hbox_lower = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); GtkWidget *alignment = gtk_alignment_new (0, 0.5, 0, 0); GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL); diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index efe6a40032..74d900e89a 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -697,7 +697,7 @@ static void psppire_syntax_window_init (PsppireSyntaxWindow *window) { GtkBuilder *xml = builder_new ("syntax-editor.ui"); - GtkWidget *box = gtk_vbox_new (FALSE, 0); + GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); GtkWidget *menubar = get_widget_assert (xml, "menubar"); GtkWidget *sw = get_widget_assert (xml, "scrolledwindow8"); diff --git a/src/ui/gui/psppire-val-chooser.c b/src/ui/gui/psppire-val-chooser.c index de48ba37f4..a4c7494ecc 100644 --- a/src/ui/gui/psppire-val-chooser.c +++ b/src/ui/gui/psppire-val-chooser.c @@ -296,7 +296,7 @@ static void range_set (PsppireValChooser *vr, struct old_value *ov, const struct static GtkWidget * range_entry (struct layout *l, struct range_widgets *rw) { - GtkWidget *vbox = gtk_vbox_new (FALSE, 3); + GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); GtkWidget *entrylo = gtk_entry_new (); GtkWidget *label = gtk_label_new (_("through")); GtkWidget *entryhi = gtk_entry_new ();