Re: [gtkmm] Setting the background color of a specific cell in a Gtk::Treeview



Thank you for the help, I looked at the FileTree::text_cell_data_func example and I think having that custom cellrenderer using the model data would solve my problem.
Liza

Daniel Elstner wrote:

On Fre, 2003-01-10 at 10:17, Murray Cumming wrote:

On Fri, 2003-01-10 at 03:31, Liza Klerck wrote:

I'm sorry, some confusion occured in the message. The code example I included was a response to someone asking how to set the color of an entire column.

My question still remains, if I have a TreeViewColumn variable and a TreeModelRow variable how do I use those to get at the cell's cellrender ? The cell being represented by the intersection of the TreeViewColumn and the TreeModelRow.
You do not usually access the data via a CellRenderer directly - data
should be set in the model. You just use an appropriate, or
appropriately setup, CellRenderer. If you give more details then we
might be able to help more.


It sounds like you want to install a cell_data_func() that sets
CellRenderer properties based on model data.  See

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/regexxer/regexxer/src/filetree.cc?rev=1.39&content-type=text/vnd.viewcvs-markup

for an example.  FileTree::text_cell_data_func() sets the foreground
color of text cells based on model information.

--Daniel







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