7 #include "psppire-spreadsheet-model.h"
9 #include "data/gnumeric-reader.h"
19 GtkListStore * list_store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
21 for (i = 0; i < N; ++i)
23 gtk_list_store_append (list_store, &iter);
24 gtk_list_store_set (list_store, &iter,
33 main (int argc, char *argv[] )
41 struct spreadsheet *sp = NULL;
42 gtk_init (&argc, &argv);
45 g_error ("Usage: prog file\n");
47 sp = gnumeric_probe (argv[1]);
51 g_error ("%s is not a gnumeric file\n", argv[1]);
57 tm = psppire_spreadsheet_model_new (sp);
58 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
59 hbox = gtk_hbox_new (FALSE, 5);
60 vbox = gtk_vbox_new (FALSE, 5);
62 gtk_container_set_border_width (GTK_CONTAINER (window), 10);
64 // tm = GTK_TREE_MODEL (make_store ());
65 combo_box = gtk_combo_box_new_with_model (tm);
68 GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
69 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
70 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
77 gtk_combo_box_set_active (combo_box, 0);
79 treeview = gtk_tree_view_new_with_model (tm);
81 gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
83 gtk_cell_renderer_text_new (),
88 gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
90 gtk_cell_renderer_text_new (),
95 gtk_box_pack_start (GTK_BOX (hbox), treeview, TRUE, TRUE, 5);
97 gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 5);
98 gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 5);
100 gtk_container_add (GTK_CONTAINER (window), hbox);
102 gtk_widget_show_all (window);