aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-04 17:42:53 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-04 17:42:53 +0800
commit86ec9f6f4938ccc47698ec0a753c8e6946bd8ec3 (patch)
tree17e8f0b8745ed76d0182ae1c1577f0e2dd32542a /widgets
parentee35e293947fc25aabcab99df5f44957d969eefe (diff)
downloadgsoc2013-evolution-86ec9f6f4938ccc47698ec0a753c8e6946bd8ec3.tar.gz
gsoc2013-evolution-86ec9f6f4938ccc47698ec0a753c8e6946bd8ec3.tar.zst
gsoc2013-evolution-86ec9f6f4938ccc47698ec0a753c8e6946bd8ec3.zip
Sometimes put off maybe showing the cursor until an idle callback.
2001-10-04 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_idle_maybe_show_cursor): Sometimes put off maybe showing the cursor until an idle callback. * e-tree-selection-model.c (add_model): Use connect_after to connect to all the signals. This means we can assume the sorted tree and table adapters are both done. This also means that those objects cannot assume that the selection is already changed. svn path=/trunk/; revision=13406
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-item.c24
-rw-r--r--widgets/table/e-tree-selection-model.c24
2 files changed, 35 insertions, 13 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 473901bf67..794c64dc84 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -816,6 +816,24 @@ eti_maybe_show_cursor(ETableItem *eti, int delay)
eti_check_cursor_bounds (eti);
}
+static gboolean
+eti_idle_maybe_show_cursor_cb (gpointer data)
+{
+ ETableItem *eti = data;
+ if (!GTK_OBJECT_DESTROYED (eti)) {
+ eti_maybe_show_cursor (eti, 0);
+ }
+ gtk_object_unref (GTK_OBJECT (eti));
+ return FALSE;
+}
+
+static void
+eti_idle_maybe_show_cursor(ETableItem *eti)
+{
+ gtk_object_ref (GTK_OBJECT (eti));
+ g_idle_add (eti_idle_maybe_show_cursor_cb, eti);
+}
+
/*
* Callback routine: invoked before the ETableModel has suffers a change
*/
@@ -845,7 +863,7 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti)
eti->needs_redraw = 1;
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
- eti_maybe_show_cursor(eti, 0);
+ eti_idle_maybe_show_cursor(eti);
}
static void
@@ -893,6 +911,8 @@ eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETa
eti->height_cache[i] = -1;
}
+ eti_idle_maybe_show_cursor(eti);
+
eti->needs_compute_height = 1;
e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
eti->needs_redraw = 1;
@@ -915,6 +935,8 @@ eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETab
memmove(eti->height_cache + row, eti->height_cache + row + count, (eti->rows - row) * sizeof(int));
}
+ eti_idle_maybe_show_cursor(eti);
+
eti->needs_compute_height = 1;
e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
eti->needs_redraw = 1;
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index 1a17ed2da1..fca526eaf0 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -438,18 +438,18 @@ add_model(ETreeSelectionModel *etsm, ETreeModel *model)
return;
gtk_object_ref(GTK_OBJECT(priv->model));
- priv->tree_model_pre_change_id = gtk_signal_connect (GTK_OBJECT (priv->model), "pre_change",
- GTK_SIGNAL_FUNC (etsm_pre_change), etsm);
- priv->tree_model_node_changed_id = gtk_signal_connect (GTK_OBJECT (priv->model), "node_changed",
- GTK_SIGNAL_FUNC (etsm_node_changed), etsm);
- priv->tree_model_node_data_changed_id = gtk_signal_connect (GTK_OBJECT (priv->model), "node_data_changed",
- GTK_SIGNAL_FUNC (etsm_node_data_changed), etsm);
- priv->tree_model_node_col_changed_id = gtk_signal_connect (GTK_OBJECT (priv->model), "node_col_changed",
- GTK_SIGNAL_FUNC (etsm_node_col_changed), etsm);
- priv->tree_model_node_inserted_id = gtk_signal_connect (GTK_OBJECT (priv->model), "node_inserted",
- GTK_SIGNAL_FUNC (etsm_node_inserted), etsm);
- priv->tree_model_node_removed_id = gtk_signal_connect (GTK_OBJECT (priv->model), "node_removed",
- GTK_SIGNAL_FUNC (etsm_node_removed), etsm);
+ priv->tree_model_pre_change_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "pre_change",
+ GTK_SIGNAL_FUNC (etsm_pre_change), etsm);
+ priv->tree_model_node_changed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_changed",
+ GTK_SIGNAL_FUNC (etsm_node_changed), etsm);
+ priv->tree_model_node_data_changed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_data_changed",
+ GTK_SIGNAL_FUNC (etsm_node_data_changed), etsm);
+ priv->tree_model_node_col_changed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_col_changed",
+ GTK_SIGNAL_FUNC (etsm_node_col_changed), etsm);
+ priv->tree_model_node_inserted_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_inserted",
+ GTK_SIGNAL_FUNC (etsm_node_inserted), etsm);
+ priv->tree_model_node_removed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_removed",
+ GTK_SIGNAL_FUNC (etsm_node_removed), etsm);
}
static void