Re: gtk_tree_view - gtk2.0



hi all,

thank u all for the support  given.
ur guidance have been really helpful... :)
Regds,

bijoy.

Martyn Russell wrote:
On Fri, 2002-10-11 at 16:43, stephane wrote:
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.......

Run the demo that comes with gtk2. it's called 'gtk-demo' and it comes
with the source.

Regards,

Martyn

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_a dd (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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



________________________________________________________________________ Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!! visit http://in.autos.yahoo.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]