aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/e-table/ChangeLog7
-rw-r--r--widgets/e-table/e-table.c37
-rw-r--r--widgets/e-table/e-table.h4
-rw-r--r--widgets/table/e-table.c37
-rw-r--r--widgets/table/e-table.h4
5 files changed, 65 insertions, 24 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index e1b93253b2..3bbbf0d67c 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,10 @@
+2000-04-14 Miguel de Icaza <miguel@gnu.org>
+
+ * e-table.c, e-table.h: Switch the parent object to be a GtkTable.
+ (et_real_construct): apply massaging and some loving action to
+ make the thing behave as a GtkTable.
+ (e_table_init): More love.
+
2000-04-12 Miguel de Icaza <miguel@gnu.org>
* e-table-header-item.c (ethi_drag_motion): Remove test for
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index bf3f2127ba..6906f3af84 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -31,7 +31,7 @@
#define TITLE_HEIGHT 16
#define GROUP_INDENT 10
-#define PARENT_TYPE gtk_hbox_get_type ()
+#define PARENT_TYPE gtk_table_get_type ()
static GtkObjectClass *e_table_parent_class;
@@ -83,6 +83,9 @@ static void
e_table_init (GtkObject *object)
{
ETable *e_table = E_TABLE (object);
+ GtkTable *gtk_table = GTK_TABLE (object);
+
+ gtk_table->homogeneous = FALSE;
e_table->sort_info = NULL;
e_table->sort_info_change_id = 0;
@@ -780,20 +783,34 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
e_table_setup_header (e_table);
e_table_setup_table (e_table, full_header, e_table->header, etm);
e_table_fill_table (e_table, etm);
-
- vbox = gtk_vbox_new (FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->header_canvas), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->table_canvas), TRUE, TRUE, 0);
- gtk_widget_show (vbox);
-
- gtk_box_pack_start (GTK_BOX (e_table), vbox, TRUE, TRUE, 0);
+ /*
+ * The header
+ */
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas),
+ 1, 2, 1, 2,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL, 0, 0);
+ /*
+ * The body
+ */
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
+ 1, 2, 2, 3,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL | GTK_EXPAND, 0, 0);
+
vscrollbar = gtk_vscrollbar_new (gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
gtk_widget_show (vscrollbar);
- gtk_box_pack_start (GTK_BOX (e_table), vscrollbar, FALSE, FALSE, 0);
+ gtk_table_attach (
+ GTK_TABLE (e_table), vscrollbar,
+ 2, 3, 2, 3,
+ GTK_FILL,
+ GTK_FILL | GTK_EXPAND, 0, 0);
+
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
}
diff --git a/widgets/e-table/e-table.h b/widgets/e-table/e-table.h
index 39333f159a..d8c4709621 100644
--- a/widgets/e-table/e-table.h
+++ b/widgets/e-table/e-table.h
@@ -19,7 +19,7 @@ BEGIN_GNOME_DECLS
#define E_IS_TABLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_TYPE))
typedef struct {
- GtkHBox parent;
+ GtkTable parent;
ETableModel *model;
@@ -54,7 +54,7 @@ typedef struct {
} ETable;
typedef struct {
- GtkHBoxClass parent_class;
+ GtkTableClass parent_class;
void (*row_selection) (ETable *et, int row, gboolean selected);
} ETableClass;
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index bf3f2127ba..6906f3af84 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -31,7 +31,7 @@
#define TITLE_HEIGHT 16
#define GROUP_INDENT 10
-#define PARENT_TYPE gtk_hbox_get_type ()
+#define PARENT_TYPE gtk_table_get_type ()
static GtkObjectClass *e_table_parent_class;
@@ -83,6 +83,9 @@ static void
e_table_init (GtkObject *object)
{
ETable *e_table = E_TABLE (object);
+ GtkTable *gtk_table = GTK_TABLE (object);
+
+ gtk_table->homogeneous = FALSE;
e_table->sort_info = NULL;
e_table->sort_info_change_id = 0;
@@ -780,20 +783,34 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
e_table_setup_header (e_table);
e_table_setup_table (e_table, full_header, e_table->header, etm);
e_table_fill_table (e_table, etm);
-
- vbox = gtk_vbox_new (FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->header_canvas), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->table_canvas), TRUE, TRUE, 0);
- gtk_widget_show (vbox);
-
- gtk_box_pack_start (GTK_BOX (e_table), vbox, TRUE, TRUE, 0);
+ /*
+ * The header
+ */
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas),
+ 1, 2, 1, 2,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL, 0, 0);
+ /*
+ * The body
+ */
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
+ 1, 2, 2, 3,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL | GTK_EXPAND, 0, 0);
+
vscrollbar = gtk_vscrollbar_new (gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
gtk_widget_show (vscrollbar);
- gtk_box_pack_start (GTK_BOX (e_table), vscrollbar, FALSE, FALSE, 0);
+ gtk_table_attach (
+ GTK_TABLE (e_table), vscrollbar,
+ 2, 3, 2, 3,
+ GTK_FILL,
+ GTK_FILL | GTK_EXPAND, 0, 0);
+
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
}
diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h
index 39333f159a..d8c4709621 100644
--- a/widgets/table/e-table.h
+++ b/widgets/table/e-table.h
@@ -19,7 +19,7 @@ BEGIN_GNOME_DECLS
#define E_IS_TABLE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_TYPE))
typedef struct {
- GtkHBox parent;
+ GtkTable parent;
ETableModel *model;
@@ -54,7 +54,7 @@ typedef struct {
} ETable;
typedef struct {
- GtkHBoxClass parent_class;
+ GtkTableClass parent_class;
void (*row_selection) (ETable *et, int row, gboolean selected);
} ETableClass;