4 #include "ast-inspect.h"
7 create_view_and_model (void *ptr
)
9 GtkTreeViewColumn
*text
;
10 GtkCellRenderer
*renderer
;
14 root
= ast_new(NULL
, 0, "", ptr
, inspect_symbol_list
);
16 view
= gtk_tree_view_new_with_model(GTK_TREE_MODEL(root
));
18 g_object_unref(root
); /* destroy store automatically with view */
20 renderer
= gtk_cell_renderer_text_new();
21 text
= gtk_tree_view_column_new_with_attributes("Node", renderer
,
24 gtk_tree_view_append_column(GTK_TREE_VIEW(view
), text
);
30 treeview_main (struct symbol_list
*syms
)
32 GtkWidget
*window
, *view
, *scrollwin
;
34 window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
35 gtk_window_set_default_size (GTK_WINDOW(window
), 600, 800);
36 g_signal_connect(window
, "delete_event", gtk_main_quit
, NULL
);
38 scrollwin
= gtk_scrolled_window_new(NULL
,NULL
);
40 view
= create_view_and_model(syms
);
42 gtk_container_add(GTK_CONTAINER(scrollwin
), view
);
43 gtk_container_add(GTK_CONTAINER(window
), scrollwin
);
45 gtk_widget_show_all(window
);