aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-table/e-table.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnu.org>2000-02-07 21:08:33 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2000-02-07 21:08:33 +0800
commit99d71d11328fa1f6d2f0156de63a44142cf99d9c (patch)
treee9b25df47c42c250819ef9ec8e7dc21309bd6865 /widgets/e-table/e-table.c
parentdec6d6b0971480b8910c301daa6218abe3f2eee0 (diff)
downloadgsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar.gz
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar.bz2
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar.lz
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar.xz
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.tar.zst
gsoc2013-evolution-99d71d11328fa1f6d2f0156de63a44142cf99d9c.zip
Setup the scroll region of the table canvas on size allocation.
2000-02-07 Miguel de Icaza <miguel@gnu.org> * e-table.c (e_table_setup_table): Setup the scroll region of the table canvas on size allocation. (e_table_canvas_realize): Do not set the scrollregion here. (e_table_canvas_init): Move root initialization here. svn path=/trunk/; revision=1683
Diffstat (limited to 'widgets/e-table/e-table.c')
-rw-r--r--widgets/e-table/e-table.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index a42aaf111b..c9a85b87b6 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -434,23 +434,11 @@ e_table_canvas_realize (GtkWidget *widget)
groups = group_spec_to_desc (e_table->group_spec);
- e_table->root = gnome_canvas_item_new (
- GNOME_CANVAS_GROUP (e_table->table_canvas->root),
- gnome_canvas_group_get_type (),
- "x", 0.0,
- "y", 0.0,
- NULL);
-
leaf = e_table_create_nodes (
e_table, e_table->model,
e_table->header, GNOME_CANVAS_GROUP (e_table->root), 0, groups);
- gnome_canvas_set_scroll_region (
- GNOME_CANVAS (e_table_canvas),
- 0, 0,
- e_table_header_total_width (e_table->header) + 200,
- leaf_height (leaf));
-
+
if (groups)
g_free (groups);
}
@@ -482,6 +470,14 @@ static void
e_table_canvas_init (GtkObject *canvas)
{
GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS);
+
+ e_table->root = gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (e_table->table_canvas->root),
+ gnome_canvas_group_get_type (),
+ "x", 0.0,
+ "y", 0.0,
+ NULL);
+
}
GtkType e_table_canvas_get_type (void);
@@ -501,9 +497,20 @@ e_table_canvas_new (ETable *e_table)
}
static void
+table_canvas_size_alocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table)
+{
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS (e_table->table_canvas),
+ 0, 0, alloc->width, alloc->height);
+}
+
+static void
e_table_setup_table (ETable *e_table)
{
e_table->table_canvas = e_table_canvas_new (e_table);
+ gtk_signal_connect (
+ GTK_OBJECT (e_table->table_canvas), "size_allocate",
+ GTK_SIGNAL_FUNC (table_canvas_size_alocate), e_table);
gtk_widget_show (GTK_WIDGET (e_table->table_canvas));
gtk_table_attach (