[gnumeric] Improve event handling for function tooltips
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Improve event handling for function tooltips
- Date: Tue, 15 Jun 2010 05:33:17 +0000 (UTC)
commit 230b222b7f9881c0c2a6a8c346a48e5cf132232d
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Mon Jun 14 23:32:24 2010 -0600
Improve event handling for function tooltips
2010-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
* gnumeric-expr-entry.c (cb_gee_configure_event): delete
(cb_gee_focus_out_event): new
(gee_create_tooltip): replace configure-event with
focus-out-event
src/widgets/ChangeLog | 7 +++++++
src/widgets/gnumeric-expr-entry.c | 29 ++++++++++++++++-------------
2 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index e68946c..7f4681d 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,5 +1,12 @@
2010-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * gnumeric-expr-entry.c (cb_gee_configure_event): delete
+ (cb_gee_focus_out_event): new
+ (gee_create_tooltip): replace configure-event with
+ focus-out-event
+
+2010-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* gnumeric-expr-entry.c (gee_check_tooltip): skip regular
parentheses and unknown functions.
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index ac49179..a177d66 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -593,7 +593,6 @@ gee_delete_tooltip (GnmExprEntry *gee)
gee->tooltip.handlerid);
gee->tooltip.handlerid = 0;
}
-
}
void
@@ -603,16 +602,10 @@ gnm_expr_entry_close_tips (GnmExprEntry *gee)
gee_delete_tooltip (gee);
}
-
-
static gboolean
-cb_gee_configure_event (GtkWidget *widget,
- GdkEventConfigure *event,
- gpointer user_data)
-{
- gee_delete_tooltip (user_data);
- return FALSE;
-}
+cb_gee_focus_out_event (GtkWidget *widget,
+ GdkEventFocus *event,
+ gpointer user_data);
static GtkWidget *
gee_create_tooltip (GnmExprEntry *gee, gchar const *str)
@@ -627,11 +620,12 @@ gee_create_tooltip (GnmExprEntry *gee, gchar const *str)
toplevel = GTK_WINDOW (gtk_widget_get_toplevel
(GTK_WIDGET (gee->entry)));
- gtk_widget_add_events(GTK_WIDGET(toplevel), GDK_CONFIGURE);
+ gtk_widget_add_events(GTK_WIDGET(toplevel),
+ GDK_FOCUS_CHANGE_MASK);
if (gee->tooltip.handlerid == 0)
gee->tooltip.handlerid = g_signal_connect
- (G_OBJECT (toplevel), "configure-event",
- G_CALLBACK (cb_gee_configure_event), gee);
+ (G_OBJECT (toplevel), "focus-out-event",
+ G_CALLBACK (cb_gee_focus_out_event), gee);
screen = gtk_window_get_screen (toplevel);
@@ -779,6 +773,15 @@ gee_check_tooltip (GnmExprEntry *gee)
return;
}
+static gboolean
+cb_gee_focus_out_event (GtkWidget *widget,
+ GdkEventFocus *event,
+ gpointer user_data)
+{
+ gee_delete_tooltip (user_data);
+ return FALSE;
+}
+
static void
cb_gee_notify_cursor_position (GnmExprEntry *gee)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]