Re: gtk_tree_view - gtk2.0
- From: stephane <f84sbh worldonline fr>
- To: gtk-app-devel-list gnome org
- Subject: Re: gtk_tree_view - gtk2.0
- Date: Fri, 11 Oct 2002 17:43:38 +0200
hi all
can anyone pliz give me a short description on how a gtk_tree_view in
gtk2.0 works,
or how it can replace the depricated gtk_tree .
any url to some docs or examples will also be helpful.
thanks for any help.......
regds,
bijoy.
hi an example for you
static GtkTreeModel *
create_result_model (void)
{
file_selection = gtk_list_store_new (SELECT_COL,
G_TYPE_STRING,
G_TYPE_INT,
G_TYPE_STRING);
return GTK_TREE_MODEL (file_selection);
}
static void
add_result_columns (GtkTreeView * treeview)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Name"),
renderer,
"text",
SELECT_NAME, NULL);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column),
80);
gtk_tree_view_append_column (treeview, column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Size"),
renderer,
"text",
SELECT_SIZE, NULL);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column),
80);
gtk_tree_view_append_column (treeview, column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Info"),
renderer,
"text",
SELECT_TYPE, NULL);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column),
80);
gtk_tree_view_append_column (treeview, column);
}
int main()
{
........ result_model = create_result_model();
treeview_result = gtk_tree_view_new_with_model(result_model);
gtk_container_add (GTK_CONTAINER(scrw1), treeview_result);
gtk_widget_show(treeview_result);
add_result_columns(GTK_TREE_VIEW(treeview_result));
......
}
hope this short thing can help you
best regards
stephane
gcompressor.sourceforge.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]