Re: Gdk::Pixbuf in TreeView.



On Fri, 2007-12-14 at 19:19 +0530, Surya Kiran Gullapalli wrote:
> Hi all,
> I'm trying to add a pixbuf (created on the fly) into a treeview.
> I've two columns a text and an image. When i add rows with appropriate
> data, I'm seeing the text, but not the image.

> void ExampleWindow :: on_realize (void)
> {
> 	Gtk::CellRendererPixbuf *crpb = new Gtk::CellRendererPixbuf ;
> 	int cols = m_TreeView.append_column ("Color", *crpb) ;
> 	Gtk::TreeViewColumn* pc = m_TreeView.get_column (cols - 1) ;
> 	pc->add_attribute (crpb->property_pixbuf(), m_Columns.m_image) ;
> 
> 	m_TreeView.append_column("Name", m_Columns.m_name);
> 	Gtk::Window::on_realize () ;
> }

I just do

m_TreeView.append_column("Color", m_Columns.m_image) ;

and did not bother with a cell renderer.

Hub



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