4 #include "ast-inspect.h"
8 create_view_and_model (void *ptr
)
10 GtkTreeViewColumn
*text
;
11 GtkCellRenderer
*renderer
;
15 root
= ast_new(NULL
, 0, "", ptr
, inspect_symbol_list
);
17 view
= gtk_tree_view_new_with_model(GTK_TREE_MODEL(root
));
19 g_object_unref(root
); /* destroy store automatically with view */
21 renderer
= gtk_cell_renderer_text_new();
22 text
= gtk_tree_view_column_new_with_attributes("Node", renderer
,
25 gtk_tree_view_append_column(GTK_TREE_VIEW(view
), text
);
31 treeview_main (struct symbol_list
*syms
)
33 GtkWidget
*window
, *view
, *scrollwin
;
35 window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
36 gtk_window_set_default_size (GTK_WINDOW(window
), 600, 800);
37 g_signal_connect(window
, "delete_event", gtk_main_quit
, NULL
);
39 scrollwin
= gtk_scrolled_window_new(NULL
,NULL
);
41 view
= create_view_and_model(syms
);
43 gtk_container_add(GTK_CONTAINER(scrollwin
), view
);
44 gtk_container_add(GTK_CONTAINER(window
), scrollwin
);
46 gtk_widget_show_all(window
);