[tasks] Only use tooltips if the GTK+ supports it
- From: Ross Burton <rburton src gnome org>
- To: svn-commits-list gnome org
- Subject: [tasks] Only use tooltips if the GTK+ supports it
- Date: Fri, 24 Apr 2009 03:02:50 -0400 (EDT)
commit ae4eaae5157c9727309b0c3ca73ad66769581d8b
Author: Ross Burton <ross linux intel com>
Date: Thu Apr 23 18:49:34 2009 +0100
Only use tooltips if the GTK+ supports it
---
configure.ac | 4 ++++
libkoto/koto-task-view.c | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index ddbca9f..cd9f3a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,10 @@ AM_CONDITIONAL(HAVE_GREGEX, test "x$have_regex" = "xyes")
AC_CHECK_DECLS([GDK_WINDOW_TYPE_HINT_COMBO, gtk_style_lookup_color],
[], [], [#include <gtk/gtk.h>])
+# This was introduced in GTK+ 2.12
+AC_CHECK_DECLS([gtk_widget_set_has_tooltip],
+ [], [], [#include <gtk/gtk.h>])
+
# This was introduced in GTK+ 2.14
AC_CHECK_DECLS([gtk_show_uri],
[], [], [#include <gtk/gtk.h>])
diff --git a/libkoto/koto-task-view.c b/libkoto/koto-task-view.c
index c182bdc..e93b7eb 100644
--- a/libkoto/koto-task-view.c
+++ b/libkoto/koto-task-view.c
@@ -263,6 +263,7 @@ on_note_activated (KotoCellRendererPixbuf *cell, const char *path, GtkTreeView *
}
}
+#if HAVE_DECL_GTK_WIDGET_SET_HAS_TOOLTIP
static gboolean
on_query_tooltip (GtkWidget *widget,
int x, int y,
@@ -309,6 +310,7 @@ on_query_tooltip (GtkWidget *widget,
return ret;
}
+#endif
/*
* Object methods.
@@ -517,8 +519,10 @@ koto_task_view_init (KotoTaskView *self)
gtk_tree_view_append_column (treeview, column);
+#if HAVE_DECL_GTK_WIDGET_SET_HAS_TOOLTIP
gtk_widget_set_has_tooltip (GTK_WIDGET (treeview), TRUE);
g_signal_connect (treeview, "query-tooltip", G_CALLBACK (on_query_tooltip), NULL);
+#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]