An image on a TreeView cell



I have copied from the gtkmm documentation an example of a treeview
table with a progress-bar.. i haver tried top modify the code to change
the progress bar to a image.. like this:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
row[m_Columns.m_col_image] = "./skin/cerrar.png"; //set the path to the
image
row[m_Columns.m_col_foo] = false;
row[m_Columns.m_col_name] = "Scan3";
row[m_Columns.m_col_number] = 1232;

//Add the TreeView's view columns:
//We use the *_editable convenience methods for most of these,
//because the default functionality is enough:
	
//Display a image bar instead of a text:
Gtk::Image* cell = new Gtk::Image;
int cols_count = m_TreeView.append_column("Tipo", *cell);
Gtk::TreeViewColumn* pColumn = m_TreeView.get_column(cols_count - 1);
	if(pColumn)
	{
	#ifdef GLIBMM_PROPERTIES_ENABLED
	pColumn->add_attribute(cell->set(), m_Columns.m_col_image);
	#else
	pColumn->add_attribute(*cell, "value", m_Columns.m_col_image);
	#endif
	}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

the biulder crashes in two pints:

int cols_count = m_TreeView.append_column("Tipo", *cell); <-- imposible
to appned an image

pColumn->add_attribute(cell->set(), m_Columns.m_col_image); <--
Gtk::Image::set() function not found...

any idea abaut how to add an image to an a treview cell...??

thanks







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