aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/test-table.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-20 02:47:16 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-20 02:47:16 +0800
commit46f211579d1dfd60147099942b40c9697796e7c8 (patch)
tree5f8e8027e3e378bd2c8061ecf10061f4609ab02e /widgets/table/test-table.c
parentae208c7e8ff0463666c52392553af2572a8ee9b5 (diff)
downloadgsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar.gz
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar.bz2
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar.lz
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar.xz
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.tar.zst
gsoc2013-evolution-46f211579d1dfd60147099942b40c9697796e7c8.zip
Added initialize_value and value_is_empty callbacks.
2000-05-19 Christopher James Lahey <clahey@helixcode.com> * e-table-example-1.c, e-table-example-2.c, e-table-simple.c, e-table-simple.h, e-table-size-test.c, test-check.c, test-cols.c, test-table.c: Added initialize_value and value_is_empty callbacks. * e-table-model.c, e-table-model.h: Added initialize_value and value_is_callback virtual functions to the ETableModel class. * e-table-subset.c: Perpetuate the initialize_value and value_is_empty methods. svn path=/trunk/; revision=3138
Diffstat (limited to 'widgets/table/test-table.c')
-rw-r--r--widgets/table/test-table.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
index a882b8dbdf..724090d904 100644
--- a/widgets/table/test-table.c
+++ b/widgets/table/test-table.c
@@ -190,6 +190,18 @@ free_value (ETableModel *etc, int col, void *value, void *data)
g_free (value);
}
+static void *
+initialize_value (ETableModel *etc, int col, void *data)
+{
+ return g_strdup ("");
+}
+
+static gboolean
+value_is_empty (ETableModel *etc, int col, const void *value, void *data)
+{
+ return !(value && *(char *)value);
+}
+
static void
thaw (ETableModel *etc, void *data)
{
@@ -220,7 +232,9 @@ table_browser_test (void)
e_table_model = e_table_simple_new (
col_count, row_count, value_at,
set_value_at, is_cell_editable,
- duplicate_value, free_value, thaw, NULL);
+ duplicate_value, free_value,
+ initialize_value, value_is_empty,
+ thaw, NULL);
/*
* Header
@@ -315,7 +329,8 @@ do_e_table_demo (const char *spec)
e_table_model =
e_table_simple_new (col_count, row_count, value_at,
set_value_at, is_cell_editable,
- duplicate_value, free_value,
+ duplicate_value, free_value,
+ initialize_value, value_is_empty,
thaw, NULL);
full_header = e_table_header_new ();