[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/17] pspp-sheet-view-column: Add support for tooltips on column
From: |
Ben Pfaff |
Subject: |
[PATCH 06/17] pspp-sheet-view-column: Add support for tooltips on columns. |
Date: |
Sun, 22 Apr 2012 11:12:24 -0700 |
---
src/ui/gui/marshaller-list | 1 +
src/ui/gui/pspp-sheet-view-column.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/ui/gui/marshaller-list b/src/ui/gui/marshaller-list
index 02c7ff6..3cf5a9c 100644
--- a/src/ui/gui/marshaller-list
+++ b/src/ui/gui/marshaller-list
@@ -6,6 +6,7 @@ BOOLEAN:ENUM
BOOLEAN:ENUM,INT
BOOLEAN:BOXED,BOXED
BOOLEAN:BOXED,POINTER
+BOOLEAN:OBJECT
BOOLEAN:VOID
VOID:BOXED,BOXED
VOID:BOXED,OBJECT
diff --git a/src/ui/gui/pspp-sheet-view-column.c
b/src/ui/gui/pspp-sheet-view-column.c
index 227bd12..1677953 100644
--- a/src/ui/gui/pspp-sheet-view-column.c
+++ b/src/ui/gui/pspp-sheet-view-column.c
@@ -73,6 +73,7 @@ enum
enum
{
CLICKED,
+ QUERY_TOOLTIP,
LAST_SIGNAL
};
@@ -201,6 +202,16 @@ pspp_sheet_view_column_class_init
(PsppSheetViewColumnClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ tree_column_signals[QUERY_TOOLTIP] =
+ g_signal_new (I_("query-tooltip"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ g_signal_accumulator_true_handled, NULL,
+ psppire_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1,
+ GTK_TYPE_TOOLTIP);
+
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
@@ -813,6 +824,22 @@ pspp_sheet_view_column_clear_attributes_by_info
(PsppSheetViewColumn *tree_colum
_pspp_sheet_view_column_cell_set_dirty (tree_column);
}
+static gboolean
+on_query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ gpointer user_data)
+{
+ PsppSheetViewColumn *tree_column = user_data;
+ gboolean handled;
+
+ g_signal_emit (tree_column, tree_column_signals[QUERY_TOOLTIP], 0,
+ tooltip, &handled);
+ return handled;
+}
+
/* Helper functions
*/
@@ -847,6 +874,10 @@ pspp_sheet_view_column_create_button (PsppSheetViewColumn
*tree_column)
G_CALLBACK (pspp_sheet_view_column_button_clicked),
tree_column);
+ g_signal_connect (tree_column->button, "query-tooltip",
+ G_CALLBACK (on_query_tooltip), tree_column);
+ g_object_set (tree_column->button, "has-tooltip", TRUE, NULL);
+
tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0,
0.0);
hbox = gtk_hbox_new (FALSE, 2);
--
1.7.2.5
- [PATCH 00/17] Implement PsppSheetView, Ben Pfaff, 2012/04/22
- [PATCH 04/17] pspp-sheet-view: Fix visual artifacts for sheet views > 65535 pixels wide., Ben Pfaff, 2012/04/22
- [PATCH 03/17] pspp-sheet-view: Improve scrolling performance., Ben Pfaff, 2012/04/22
- [PATCH 05/17] pspp-sheet-view: Fix rendering moving cursor left or right with keyboard., Ben Pfaff, 2012/04/22
- [PATCH 06/17] pspp-sheet-view-column: Add support for tooltips on columns.,
Ben Pfaff <=
- [PATCH 07/17] pspp-sheet-view: Edit cells on the first click by default., Ben Pfaff, 2012/04/22
- [PATCH 09/17] pspp-sheet-view: Start editing upon button release, not press., Ben Pfaff, 2012/04/22
- [PATCH 10/17] pspp-sheet-view: Add "special-cells" property to speed drawing many columns., Ben Pfaff, 2012/04/22
- [PATCH 13/17] pspp-sheet-view: Improve look of sheet when there are few columns., Ben Pfaff, 2012/04/22
- [PATCH 11/17] pspp-widget-facade: New code to measure and render some GTK+ widgets., Ben Pfaff, 2012/04/22
- [PATCH 14/17] pspp-sheet-view: Make pspp_sheet_view_stop_editing() public., Ben Pfaff, 2012/04/22