From c2f62689952f31e6b4fc1a3a3a144f1324359165 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 1 Jul 2011 17:59:10 +0200 Subject: [PATCH] Replace some obsolete Gtk macro calls --- src/ui/gui/customentry.c | 2 +- src/ui/gui/helper.h | 15 +++++++++++++++ src/ui/gui/psppire-dialog.c | 1 + src/ui/gui/psppire-keypad.c | 6 +----- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/ui/gui/customentry.c b/src/ui/gui/customentry.c index 04e738f2..b7d0ce2d 100644 --- a/src/ui/gui/customentry.c +++ b/src/ui/gui/customentry.c @@ -57,7 +57,7 @@ #include #include "customentry.h" - +#include "helper.h" static void psppire_custom_entry_class_init (PsppireCustomEntryClass *klass); static void psppire_custom_entry_init (PsppireCustomEntry *ce); diff --git a/src/ui/gui/helper.h b/src/ui/gui/helper.h index 597fdd78..afd3f9f2 100644 --- a/src/ui/gui/helper.h +++ b/src/ui/gui/helper.h @@ -76,4 +76,19 @@ GtkListStore * clone_list_store (const GtkListStore *src); void psppire_box_pack_start_defaults (GtkBox *box, GtkWidget *widget); + + +#if ! GTK_CHECK_VERSION (2,20,0) +static inline gboolean gtk_widget_get_realized (GtkWidget *w) +{ + return GTK_WIDGET_REALIZED (w); +} + +static inline gboolean gtk_widget_get_mapped (GtkWidget *w) +{ + return GTK_WIDGET_MAPPED (w); +} +#endif + + #endif diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index e7e0ad04..6f27aa54 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -23,6 +23,7 @@ #include "psppire-selector.h" #include "psppire-conf.h" #include +#include "helper.h" static void psppire_dialog_class_init (PsppireDialogClass *); static void psppire_dialog_init (PsppireDialog *); diff --git a/src/ui/gui/psppire-keypad.c b/src/ui/gui/psppire-keypad.c index 6f7865eb..d4eeff61 100644 --- a/src/ui/gui/psppire-keypad.c +++ b/src/ui/gui/psppire-keypad.c @@ -206,9 +206,6 @@ enter_leave_notify (GtkWidget *widget, if (event->type == GDK_ENTER_NOTIFY) gtk_widget_grab_focus (widget); - if (event->type == GDK_LEAVE_NOTIFY) - GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); - return FALSE; } @@ -313,8 +310,7 @@ psppire_keypad_init (PsppireKeypad *kp) const int digit_voffset = 0; const int digit_hoffset = 3; - GTK_WIDGET_SET_FLAGS (kp, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS (kp, GTK_HAS_FOCUS); + gtk_widget_set_can_focus (GTK_WIDGET (kp), TRUE); kp->dispose_has_run = FALSE; -- 2.30.2