X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fui%2Fgui%2Fpsppire-keypad.c;h=d4eeff6119a177926a19a38cc79355e09297c462;hb=811c669032a18cfff53291a98e5803afdf39db36;hp=2c4f4b0ba833564dae505cba0ff917c5f6f18ee9;hpb=43b1296aafe7582e7dbe6c2b6a8b478d7d9b0fcf;p=pspp
diff --git a/src/ui/gui/psppire-keypad.c b/src/ui/gui/psppire-keypad.c
index 2c4f4b0ba8..d4eeff6119 100644
--- a/src/ui/gui/psppire-keypad.c
+++ b/src/ui/gui/psppire-keypad.c
@@ -1,5 +1,5 @@
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,10 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
-#include
-#include
-#include
-#include
+#include
+#include
#include
#include "psppire-keypad.h"
@@ -30,7 +28,7 @@ enum {
static void psppire_keypad_class_init (PsppireKeypadClass *klass);
static void psppire_keypad_init (PsppireKeypad *kp);
-static guint keypad_signals[n_SIGNALS] = { 0 };
+static guint keypad_signals [n_SIGNALS] = { 0 };
GType
psppire_keypad_get_type (void)
@@ -124,7 +122,7 @@ psppire_keypad_class_init (PsppireKeypadClass *klass)
The order of these must correspond
to the order of the button declarations
*/
-static const char *keypad_insert_text[] = {
+static const char * const keypad_insert_text[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=",
">", ">=", "&", "|", "~", "()", NULL
@@ -208,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;
}
@@ -219,7 +214,7 @@ key_release_callback (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
- if ( ! (GTK_WIDGET_FLAGS (widget) & GTK_HAS_FOCUS) )
+ if ( ! gtk_widget_has_focus (widget))
return FALSE;
switch (event->keyval)
@@ -315,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;
@@ -338,7 +332,7 @@ psppire_keypad_init (PsppireKeypad *kp)
{
int j = i - 1;
char buf[5];
- snprintf (buf, 5, "%d", i);
+ g_snprintf (buf, 5, "%d", i);
kp->digit[i] = gtk_button_new_with_label (buf);
if ( i == 0 )