aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-table/e-table.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-03-22 07:30:07 +0800
committerChris Lahey <clahey@src.gnome.org>2000-03-22 07:30:07 +0800
commitdf898c5de4f91c1b83227edcf8b54ed88c865338 (patch)
tree43a786829c90315edafe401b60b810befa627919 /widgets/e-table/e-table.c
parentc8ca65e286a3305fe88cd38012021df27f8f7526 (diff)
downloadgsoc2013-evolution-df898c5de4f91c1b83227edcf8b54ed88c865338.tar.gz
gsoc2013-evolution-df898c5de4f91c1b83227edcf8b54ed88c865338.tar.zst
gsoc2013-evolution-df898c5de4f91c1b83227edcf8b54ed88c865338.zip
Make rectangles resize properly when receiving the "model_changed" signal.
2000-03-21 Christopher James Lahey <clahey@helixcode.com> * e-table.c: Make rectangles resize properly when receiving the "model_changed" signal. svn path=/trunk/; revision=2135
Diffstat (limited to 'widgets/e-table/e-table.c')
-rw-r--r--widgets/e-table/e-table.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index 43d3ba6e89..dfd3dda162 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -119,7 +119,7 @@ e_table_make_header (ETable *e_table, ETableHeader *full_header, xmlNode *xmlCol
}
static void
-header_canvas_size_alocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table)
+header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table)
{
gnome_canvas_set_scroll_region (
GNOME_CANVAS (e_table->header_canvas),
@@ -171,8 +171,8 @@ e_table_setup_header (ETable *e_table)
gtk_signal_connect (
GTK_OBJECT (e_table->header_canvas), "size_allocate",
- GTK_SIGNAL_FUNC (header_canvas_size_alocate), e_table);
-
+ GTK_SIGNAL_FUNC (header_canvas_size_allocate), e_table);
+
gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -1, COLUMN_HEADER_HEIGHT);
}
@@ -593,6 +593,12 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_t
}
static void
+table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table)
+{
+ table_canvas_size_allocate (GTK_WIDGET(canvas), &(GTK_WIDGET(canvas)->allocation), e_table);
+}
+
+static void
change_row (gpointer key, gpointer value, gpointer data)
{
ETable *et = E_TABLE(data);
@@ -624,6 +630,10 @@ changed_idle (gpointer data)
gtk_signal_connect(GTK_OBJECT(et->group), "row_selection",
GTK_SIGNAL_FUNC(group_row_selection), et);
e_table_fill_table(et, et->model);
+
+ gtk_object_set(GTK_OBJECT(et->group),
+ "width", (double) GTK_WIDGET(et->table_canvas)->allocation.width,
+ NULL);
} else if (et->need_row_changes) {
g_hash_table_foreach(et->row_changes_list, change_row, et);
}
@@ -676,6 +686,9 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h
GTK_OBJECT (e_table->table_canvas), "size_allocate",
GTK_SIGNAL_FUNC (table_canvas_size_allocate), e_table);
+ gtk_signal_connect (GTK_OBJECT(e_table->table_canvas), "reflow",
+ GTK_SIGNAL_FUNC (table_canvas_reflow), e_table);
+
gtk_widget_show (GTK_WIDGET (e_table->table_canvas));
e_table->group = e_table_group_new(GNOME_CANVAS_GROUP(e_table->table_canvas->root),