Re: Attaching pixmap to Tree item
- From: Martyn Russell <ginxd btopenworld com>
- To: deekshit mantampady wipro com
- Cc: GTK App List <gtk-app-devel-list gnome org>
- Subject: Re: Attaching pixmap to Tree item
- Date: 29 Aug 2002 10:05:17 +0100
On Thu, 2002-08-29 at 09:34, Deekshit Mantampady wrote:
What about using GtkTree instrad of GtkTreeView...
I assume we are talkin about using gtk2? If so GtkTree doesnt exist?!
unless it is not documented or i have missed something.
Martyn Russell wrote:
On Thu, 2002-08-29 at 08:15, Deekshit Mantampady wrote:
Hi All,
I wanted to attach pixmap for a tree item(at the time of tree initialization
and later dynamically). The tree item will have both label and pixmap(somthing
like MS Windows Explorer). Can any body help me to find the procedure for the
same.
Yea I had this problem before. It is not well documented. Here is how
you do it (note: this is just how to set up the column, effectively all
you are doing it packing more than one renderer into a single column):
GtkCellRenderer *renderer_text;
GtkCellRenderer *renderer_image;
GtkTreeViewColumn *column;
/* cell renderer's */
renderer_image = gtk_cell_renderer_pixbuf_new();
renderer_text = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new();
/* COL_IMAGE */
gtk_tree_view_column_pack_start(column,renderer_image,FALSE);
gtk_tree_view_column_add_attribute(column,
renderer_image,
"pixbuf",COL_IMAGE);
/* COL_NAME */
gtk_tree_view_column_pack_end(column,renderer_text,TRUE);
gtk_tree_view_column_add_attribute(column,
renderer_text,
"text",COL_NAME);
/* insert column */
gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview),column,-1);
Thanks in advance
Regards
Deekshit
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Regards,
Martyn
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]