From: John Darrington Date: Mon, 28 Dec 2009 10:11:28 +0000 (+0100) Subject: Removed some calls to deprecated Gtk functions X-Git-Tag: fc11-i386-build68~2 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9529d1a99cc7c288d94e5bbdb9f4263bd524da6c;p=pspp-builds.git Removed some calls to deprecated Gtk functions --- diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 40e91bc0..d7211606 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -207,7 +207,7 @@ find_dialog (GObject *o, gpointer data) buttonbox = get_widget_assert (fd.xml, "find-buttonbox"); - gtk_box_pack_start_defaults (GTK_BOX (buttonbox), find_button); + psppire_box_pack_start_defaults (GTK_BOX (buttonbox), find_button); gtk_box_reorder_child (GTK_BOX (buttonbox), find_button, 0); dialog = get_widget_assert (fd.xml, "find-dialog"); diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index b09a2f58..3e53f1ec 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -300,3 +300,12 @@ paste_syntax_in_new_window (const gchar *syntax) gtk_widget_show (se); } + + +/* gtk_box_pack_start_defaults is deprecated. + Therefore we roll our own until a better solution is found */ +void +psppire_box_pack_start_defaults (GtkBox *box, GtkWidget *widget) +{ + gtk_box_pack_start (box, widget, TRUE, TRUE, 0); +} diff --git a/src/ui/gui/helper.h b/src/ui/gui/helper.h index dfdd8932..223b6134 100644 --- a/src/ui/gui/helper.h +++ b/src/ui/gui/helper.h @@ -62,5 +62,7 @@ GtkBuilder *builder_new_real (const gchar *name); /* Create a deep copy of SRC */ GtkListStore * clone_list_store (const GtkListStore *src); +void psppire_box_pack_start_defaults (GtkBox *box, GtkWidget *widget); + #endif diff --git a/src/ui/gui/psppire-acr.c b/src/ui/gui/psppire-acr.c index c0988d84..f11283ba 100644 --- a/src/ui/gui/psppire-acr.c +++ b/src/ui/gui/psppire-acr.c @@ -38,6 +38,7 @@ #include #include "psppire-acr.h" +#include "helper.h" static void psppire_acr_init (PsppireAcr *); @@ -283,9 +284,9 @@ psppire_acr_init (PsppireAcr *acr) gtk_widget_set_sensitive (acr->remove_button, FALSE); gtk_widget_set_sensitive (acr->add_button, FALSE); - gtk_box_pack_start_defaults (GTK_BOX (bb), acr->add_button); - gtk_box_pack_start_defaults (GTK_BOX (bb), acr->change_button); - gtk_box_pack_start_defaults (GTK_BOX (bb), acr->remove_button); + psppire_box_pack_start_defaults (GTK_BOX (bb), acr->add_button); + psppire_box_pack_start_defaults (GTK_BOX (bb), acr->change_button); + psppire_box_pack_start_defaults (GTK_BOX (bb), acr->remove_button); gtk_box_pack_start (GTK_BOX (acr), bb, FALSE, TRUE, 5); diff --git a/src/ui/gui/psppire-buttonbox.c b/src/ui/gui/psppire-buttonbox.c index 28211654..ab7fe3d4 100644 --- a/src/ui/gui/psppire-buttonbox.c +++ b/src/ui/gui/psppire-buttonbox.c @@ -23,6 +23,8 @@ #include "psppire-buttonbox.h" #include "psppire-dialog.h" +#include "helper.h" + #include #define _(msgid) gettext (msgid) @@ -255,7 +257,7 @@ psppire_button_box_init (PsppireButtonBox *bb) { bb->button[PSPPIRE_BUTTON_OK] = gtk_button_new_from_stock (GTK_STOCK_OK); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_OK]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_OK]); g_signal_connect (bb->button[PSPPIRE_BUTTON_OK], "clicked", G_CALLBACK (ok_button_clicked), NULL); g_object_set (bb->button[PSPPIRE_BUTTON_OK], "no-show-all", TRUE, NULL); @@ -263,7 +265,7 @@ psppire_button_box_init (PsppireButtonBox *bb) bb->button[PSPPIRE_BUTTON_GOTO] = gtk_button_new_from_stock (GTK_STOCK_JUMP_TO); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_GOTO]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_GOTO]); g_signal_connect (bb->button[PSPPIRE_BUTTON_GOTO], "clicked", G_CALLBACK (goto_button_clicked), NULL); g_object_set (bb->button[PSPPIRE_BUTTON_GOTO], "no-show-all", TRUE, NULL); @@ -278,7 +280,7 @@ psppire_button_box_init (PsppireButtonBox *bb) g_signal_connect (bb->button[PSPPIRE_BUTTON_CONTINUE], "realize", G_CALLBACK (gtk_widget_grab_default), NULL); - gtk_box_pack_start_defaults (GTK_BOX (bb), + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_CONTINUE]); g_signal_connect (bb->button[PSPPIRE_BUTTON_CONTINUE], "clicked", G_CALLBACK (continue_button_clicked), NULL); @@ -291,25 +293,25 @@ psppire_button_box_init (PsppireButtonBox *bb) bb->button[PSPPIRE_BUTTON_PASTE] = gtk_button_new_from_stock (GTK_STOCK_PASTE); g_signal_connect (bb->button[PSPPIRE_BUTTON_PASTE], "clicked", G_CALLBACK (paste_button_clicked), NULL); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_PASTE]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_PASTE]); g_object_set (bb->button[PSPPIRE_BUTTON_PASTE], "no-show-all", TRUE, NULL); bb->button[PSPPIRE_BUTTON_CANCEL] = gtk_button_new_from_stock (GTK_STOCK_CANCEL); g_signal_connect (bb->button[PSPPIRE_BUTTON_CANCEL], "clicked", G_CALLBACK (close_dialog), NULL); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_CANCEL]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_CANCEL]); g_object_set (bb->button[PSPPIRE_BUTTON_CANCEL], "no-show-all", TRUE, NULL); bb->button[PSPPIRE_BUTTON_RESET] = gtk_button_new_from_stock ("pspp-stock-reset"); g_signal_connect (bb->button[PSPPIRE_BUTTON_RESET], "clicked", G_CALLBACK (refresh_clicked), NULL); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_RESET]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_RESET]); g_object_set (bb->button[PSPPIRE_BUTTON_RESET], "no-show-all", TRUE, NULL); bb->button[PSPPIRE_BUTTON_HELP] = gtk_button_new_from_stock (GTK_STOCK_HELP); - gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_HELP]); + psppire_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_HELP]); g_object_set (bb->button[PSPPIRE_BUTTON_HELP], "no-show-all", TRUE, NULL); diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 564d91b1..c7631c9d 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -620,8 +620,8 @@ data_save_as_dialog (PsppireDataWindow *de) (gtk_radio_button_get_group (GTK_RADIO_BUTTON(button_sys)), _("Portable File")); - gtk_box_pack_start_defaults (GTK_BOX (vbox), button_sys); - gtk_box_pack_start_defaults (GTK_BOX (vbox), button_por); + psppire_box_pack_start_defaults (GTK_BOX (vbox), button_sys); + psppire_box_pack_start_defaults (GTK_BOX (vbox), button_por); gtk_widget_show_all (vbox); diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index cea51346..4bcb5cc9 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -481,7 +481,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) while ((col = gtk_tree_view_get_column (tv, i++))) { - GList *renderers = gtk_tree_view_column_get_cell_renderers (col); + GList *renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col)); GList *start = renderers; while (renderers) { diff --git a/src/ui/gui/t-test-options.c b/src/ui/gui/t-test-options.c index ed8ac042..224b022c 100644 --- a/src/ui/gui/t-test-options.c +++ b/src/ui/gui/t-test-options.c @@ -69,7 +69,7 @@ tt_options_dialog_create (GtkBuilder *xml, GtkWindow *parent) gtk_widget_show (tto->confidence); - gtk_box_pack_start_defaults (GTK_BOX (tto->box), tto->confidence); + psppire_box_pack_start_defaults (GTK_BOX (tto->box), tto->confidence); gtk_window_set_transient_for (GTK_WINDOW (tto->dialog), parent);