aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/test-table.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1999-12-12 17:20:46 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-12-12 17:20:46 +0800
commitfa895ed8e1454d4d761b8789381ca5ba464a7c93 (patch)
tree594aa949bfdb351a0cb6646bb950744c8a791c88 /widgets/table/test-table.c
parent863f8aa634005c6400d629c353f5fed485106fce (diff)
downloadgsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.gz
gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.zst
gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.zip
More work. We now have the basics for nesting working, now we need all the
More work. We now have the basics for nesting working, now we need all the interactions done properly. I want to use a new GnomeCanvasItem for the nesting parent as well. DnD will have to be done with our own protocol to provide all the feedback we want to provide. Miguel svn path=/trunk/; revision=1481
Diffstat (limited to 'widgets/table/test-table.c')
-rw-r--r--widgets/table/test-table.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
index 04c40959af..83a130d72a 100644
--- a/widgets/table/test-table.c
+++ b/widgets/table/test-table.c
@@ -14,6 +14,9 @@
#include "e-table-item.h"
#include "e-cursors.h"
#include "e-cell-text.h"
+#include "e-table.h"
+
+#include "table-test.h"
char buffer [1024];
char **column_labels;
@@ -97,6 +100,16 @@ load_data ()
{
int i;
+ {
+ static int loaded;
+
+ if (loaded)
+ return;
+
+ loaded = TRUE;
+ }
+
+
parse_headers ();
while (fgets (buffer, sizeof (buffer)-1, stdin) != NULL){
@@ -231,3 +244,49 @@ table_browser_test (void)
NULL);
}
+static void
+do_e_table_demo (const char *col_spec, const char *group_spec)
+{
+ GtkWidget *e_table, *window;
+ ETableModel *e_table_model;
+ ECell *cell_left_just;
+ ETableHeader *full_header;
+ int i;
+
+ /*
+ * Data model
+ */
+ e_table_model = e_table_simple_new (
+ col_count, row_count, value_at,
+ set_value_at, is_cell_editable, NULL);
+
+ full_header = e_table_header_new ();
+ cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT);
+
+ for (i = 0; i < cols; i++){
+ ETableCol *ecol = e_table_col_new (
+ i, column_labels [i],
+ 80, 20, cell_left_just,
+ g_str_equal, TRUE);
+
+ e_table_header_add_column (full_header, ecol, i);
+ }
+
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ e_table = e_table_new (full_header, e_table_model, col_spec, group_spec);
+
+ gtk_container_add (GTK_CONTAINER (window), e_table);
+
+ gtk_widget_show (e_table);
+ gtk_widget_show (window);
+}
+
+void
+e_table_test (void)
+{
+ load_data ();
+ do_e_table_demo ("0,1,2,3,4", NULL);
+ do_e_table_demo ("0,1,2,3,4", "3");
+ do_e_table_demo ("0,1,2,3,4", "3,4");
+}