aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-table
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-16 13:39:06 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-16 13:39:06 +0800
commitbdef37bda345359b788d5940c58b2252bf13baa8 (patch)
tree393f623c3077fb36ae2f9faf6c0d218251c252a0 /widgets/e-table
parent4ad1d8f78370bd4604dabefc35f39c42c9991038 (diff)
downloadgsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar.gz
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar.bz2
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar.lz
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar.xz
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.tar.zst
gsoc2013-evolution-bdef37bda345359b788d5940c58b2252bf13baa8.zip
Moved the reflow signal handling into an idle handler to fix a bug when
2000-06-16 Christopher James Lahey <clahey@helixcode.com> * e-table.c, e-table.h: Moved the reflow signal handling into an idle handler to fix a bug when resizing twice in succession. svn path=/trunk/; revision=3588
Diffstat (limited to 'widgets/e-table')
-rw-r--r--widgets/e-table/ChangeLog5
-rw-r--r--widgets/e-table/e-table.c20
-rw-r--r--widgets/e-table/e-table.h2
3 files changed, 24 insertions, 3 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index eb06ac3203..d699ce3fa9 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-16 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-table.c, e-table.h: Moved the reflow signal handling into an
+ idle handler to fix a bug when resizing twice in succession.
+
2000-06-15 Chris Toshok <toshok@helixcode.com>
* e-cell-tree.c (ect_print): print the icon for the tree control.
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index f278ad11a5..d368b92716 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -83,6 +83,10 @@ et_destroy (GtkObject *object)
gtk_signal_disconnect (GTK_OBJECT (et->sort_info),
et->group_info_change_id);
+ if (et->reflow_idle_id)
+ g_source_remove(et->reflow_idle_id);
+ et->reflow_idle_id = 0;
+
gtk_object_unref (GTK_OBJECT (et->model));
gtk_object_unref (GTK_OBJECT (et->full_header));
gtk_object_unref (GTK_OBJECT (et->header));
@@ -108,6 +112,7 @@ e_table_init (GtkObject *object)
e_table->sort_info = NULL;
e_table->group_info_change_id = 0;
+ e_table->reflow_idle_id = 0;
e_table->draw_grid = 1;
e_table->draw_focus = 1;
@@ -172,11 +177,11 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
}
-static void
-table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table)
+static gboolean
+table_canvas_reflow_idle (ETable *e_table)
{
gdouble height, width;
- GtkAllocation *alloc = &(GTK_WIDGET (canvas)->allocation);
+ GtkAllocation *alloc = &(GTK_WIDGET (e_table->table_canvas)->allocation);
gtk_object_get (GTK_OBJECT (e_table->group),
"height", &height,
@@ -186,6 +191,15 @@ table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table)
gnome_canvas_set_scroll_region (
GNOME_CANVAS (e_table->table_canvas),
0, 0, MAX((int)width, alloc->width) - 1, MAX ((int)height, alloc->height) - 1);
+ e_table->reflow_idle_id = 0;
+ return FALSE;
+}
+
+static void
+table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table)
+{
+ if (!e_table->reflow_idle_id)
+ e_table->reflow_idle_id = g_idle_add_full (400, (GSourceFunc) table_canvas_reflow_idle, e_table, NULL);
}
static void
diff --git a/widgets/e-table/e-table.h b/widgets/e-table/e-table.h
index 4679af538b..a733d5951e 100644
--- a/widgets/e-table/e-table.h
+++ b/widgets/e-table/e-table.h
@@ -39,6 +39,8 @@ typedef struct {
int group_info_change_id;
+ int reflow_idle_id;
+
GnomeCanvas *header_canvas, *table_canvas;
GnomeCanvasItem *header_item, *root;