Re: gtktreeview, Put icon and text in one column.?



El jue, 12 de 02 de 2004 a las 15:24, Tom Liu escribiÃ:
I want to put icons in to gtktreeview, like the folder icon, file icon
etc.

The icon and text should be in one column. Should I make my own
RellRenderer?

Looks like that I should merge the GtkCellRendererPixbuf and
GtkCellRendererText to one Renderer. Is someone already done this?

GtkCellRendererText* text_renderer;
GtkCellRendererPixbuff* pixbuf_renderer;
GtkTreeViewColumn* col;

text_renderer = gtk_cell_renderer_text_new ();
pixbuf_renderer = gtk_cell_renderer_pixbuf_new ();
col = gtk_tree_view_column_new();

gtk_tree_view_column_pack_start (col,pixbuf_renderer,FALSE); 
gtk_tree_view_column_pack_end   (col,text_renderer,TRUE);

[...]

http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRendererPixbuf.html
http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRendererText.html
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeViewColumn.html


Hope this helps :)
-- 
Iago Rubio                http://www.iagorubio.com          
GPGkey pgp.rediris.es id 0x909BD4DD  fingerprint =
D18A B950 5F03 BB9A DD89  AA75 FEDF 1978 909B D4DD
********** iago.rubio(AT)hispalinux.es  **********     
--------------------------------------------------

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



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