aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/test-table.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@helixcode.com>2000-04-26 22:47:10 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2000-04-26 22:47:10 +0800
commit3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d (patch)
tree8380806df76f23fd1b81eefa0c0b70dba9bc1a3a /widgets/table/test-table.c
parentb2ae704032d1bd7b090b99a05be8a514b7ef1ea6 (diff)
downloadgsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.gz
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.zst
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.zip
Add argument handling here.
2000-04-24 Miguel de Icaza <miguel@helixcode.com> * e-table.c (e_table_class_init): Add argument handling here. * e-table-group-leaf.c (e_table_group_apply_to_leafs): New method. Enables us to walk all the children of an ETableGroup. * e-table.c (et_get_arg, et_set_arg): Implement ::get and ::set methods. (e_table_construct_from_spec_file): Now we return the etable. (e_table_construct): ditto. (et_real_construct): Now we return the ETable. Returns NULL on construct failure. (e_table_new): ditto. (e_table_new_from_spec_file): ditto. * (et_build_grouping_spec): Removed vestige code that still contained references to the etable->specification XML code. Dumped all the ifdefed out code. * e-table.h: Removed ETable->specification finally. svn path=/trunk/; revision=2632
Diffstat (limited to 'widgets/table/test-table.c')
-rw-r--r--widgets/table/test-table.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
index 4f2abffb13..38f690ec43 100644
--- a/widgets/table/test-table.c
+++ b/widgets/table/test-table.c
@@ -290,9 +290,18 @@ row_selection_test (ETable *table, int row, gboolean selected)
}
static void
+toggle_grid (void *nothing, ETable *etable)
+{
+ static gboolean shown;
+
+ gtk_object_get (GTK_OBJECT (etable), "drawgrid", &shown, NULL);
+ gtk_object_set (GTK_OBJECT (etable), "drawgrid", !shown, NULL);
+}
+
+static void
do_e_table_demo (const char *spec)
{
- GtkWidget *e_table, *window, *frame, *vbox, *button;
+ GtkWidget *e_table, *window, *frame, *vbox, *button, *bhide;
ECell *cell_left_just;
ETableHeader *full_header;
int i;
@@ -328,23 +337,26 @@ do_e_table_demo (const char *spec)
gtk_signal_connect (GTK_OBJECT(e_table), "row_selection",
GTK_SIGNAL_FUNC(row_selection_test), NULL);
- button = gtk_button_new_with_label ("Save spec");
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (save_spec), e_table);
-
vbox = gtk_vbox_new (FALSE, 0);
-
gtk_box_pack_start (GTK_BOX (vbox), e_table, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_add (GTK_CONTAINER (window), frame);
+ /*
+ * gadgets
+ */
+ button = gtk_button_new_with_label ("Save spec");
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (save_spec), e_table);
+ gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+
+ bhide = gtk_button_new_with_label ("Toggle Grid");
+ gtk_signal_connect (GTK_OBJECT (bhide), "clicked",
+ GTK_SIGNAL_FUNC (toggle_grid), e_table);
+ gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0);
+
gtk_widget_set_usize (window, 200, 200);
- gtk_widget_show (e_table);
- gtk_widget_show (button);
- gtk_widget_show (vbox);
- gtk_widget_show (frame);
- gtk_widget_show (window);
+ gtk_widget_show_all (window);
if (getenv ("TEST")){
e_table_do_gui_config (NULL, E_TABLE(e_table));