static void load_form_element(const xmlNode *cur_node, form_element_t *parent) { if (is_oftype(cur_node, "Group")) { const xmlNode *p = find_by_path(cur_node, "Properties/Type")->children; if (xstrcmp(p->content, "UsualGroup") == 0) load_usual_group(cur_node, parent); } if (is_oftype(cur_node, "Text")) { load_text_entry(cur_node, parent, false); } if (is_oftype(cur_node, "Input")) { load_input(cur_node, parent); } if (is_oftype(cur_node, "CheckBox")) { load_check_box(cur_node, parent); } if (is_oftype(cur_node, "Pages")) { load_pages(cur_node, parent); } if (is_oftype(cur_node, "Table")) { load_table(cur_node, parent); } if (is_oftype(cur_node, "CommandBar")) { load_command_bar(cur_node, parent); } }
GtkTreeModel *pages_setup(GtkTreeView *container, char *files[]) { GtkTreeViewColumn *col; GtkCellRenderer *rend; GtkTreeModel *model; GtkListStore *pages; pages = load_pages(files); puts("made it"); gtk_tree_view_set_headers_visible(pagelist, FALSE); /* -- column 1 - number -- */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Spread"); gtk_tree_view_append_column(GTK_TREE_VIEW(container), col); rend = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(col, rend, TRUE); gtk_tree_view_column_add_attribute(col, rend, "text", 0); /* -- column 2 - verso -- */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Verso"); gtk_tree_view_append_column(GTK_TREE_VIEW(container), col); rend = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(col, rend, TRUE); gtk_tree_view_column_add_attribute(col, rend, "pixbuf", 1); /* -- column 3 - recto -- */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, "Recto"); gtk_tree_view_append_column(GTK_TREE_VIEW(container), col); rend = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(col, rend, TRUE); gtk_tree_view_column_add_attribute(col, rend, "pixbuf", 2); model = pages; gtk_tree_view_set_model(container, model); return model; }