projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PsppireKeypad: Correct the attachment of buttons to the grid.
[pspp]
/
src
/
ui
/
gui
/
psppire-keypad.c
diff --git
a/src/ui/gui/psppire-keypad.c
b/src/ui/gui/psppire-keypad.c
index 19b8cabf4ebee05b24ef8fe82041120da35d3e8a..5cc7f52a6fff88679688fa8ba78d7167a875a556 100644
(file)
--- 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.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2010, 2011, 2015
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
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
@@
-15,11
+15,9
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtklabel.h>
+#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkkeysyms.h>
+#include <gdk/gdkkeysyms-compat.h>
#include "psppire-keypad.h"
enum {
#include "psppire-keypad.h"
enum {
@@
-162,10
+160,7
@@
add_button (PsppireKeypad *kp, GtkWidget **button,
{
g_object_set (G_OBJECT (*button), "focus-on-click", FALSE, NULL);
{
g_object_set (G_OBJECT (*button), "focus-on-click", FALSE, NULL);
- gtk_table_attach_defaults (GTK_TABLE (kp->table),
- *button,
- x1, x2,
- y1, y2);
+ gtk_grid_attach (GTK_GRID(kp->table), *button, x1, y1, x2 - x1, y2 - y1);
gtk_widget_set_size_request (*button,
30 * rows / (float) cols,
gtk_widget_set_size_request (*button,
30 * rows / (float) cols,
@@
-209,9
+204,6
@@
enter_leave_notify (GtkWidget *widget,
if (event->type == GDK_ENTER_NOTIFY)
gtk_widget_grab_focus (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;
}
return FALSE;
}
@@
-220,7
+212,7
@@
key_release_callback (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
GdkEventKey *event,
gpointer user_data)
{
- if ( !
(GTK_WIDGET_FLAGS (widget) & GTK_HAS_FOCUS)
)
+ if ( !
gtk_widget_has_focus (widget)
)
return FALSE;
switch (event->keyval)
return FALSE;
switch (event->keyval)
@@
-316,8
+308,7
@@
psppire_keypad_init (PsppireKeypad *kp)
const int digit_voffset = 0;
const int digit_hoffset = 3;
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;
kp->dispose_has_run = FALSE;
@@
-332,14
+323,14
@@
psppire_keypad_init (PsppireKeypad *kp)
kp->frag_table = g_hash_table_new (g_direct_hash, g_direct_equal);
kp->frag_table = g_hash_table_new (g_direct_hash, g_direct_equal);
- kp->table = gtk_
table_new (rows, cols, TRUE
);
+ kp->table = gtk_
grid_new (
);
/* Buttons for the digits */
for (i = 0; i < 10; i++)
{
int j = i - 1;
char buf[5];
/* Buttons for the digits */
for (i = 0; i < 10; i++)
{
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 )
kp->digit[i] = gtk_button_new_with_label (buf);
if ( i == 0 )