Re: Background row color for a Gtk::TreeView



On Thu, 2009-11-26 at 17:57 -0500, José Alburquerque wrote:
> On Thu, 2009-11-26 at 14:01 +0100, Glus Xof wrote: 
> > Hello everyone,
> > 
> > I have another question that I hope that would be enough difficult and
> > elevated that will motivate everyone (who knows it, of course...) to
> > reply me...
> > 
> > I write a Gtk::TreeView with a bool type column. Like this,
> > 
> > Gtk::TreeView m_indlist;
> > m_indlist.append_column_editable("Select", m_Columns.m_col_select);
> > 
> > That I would like is that the background row color remains in blue
> > while the cell of the column "Select" is TRUE.
> 
> Maybe by setting a slot to render the column's cell by using
> Gtk::TreeViewColumn::set_cell_data_func().  In the handler, set one of
> the Gtk::CellRenderer::property_cell_background() properties to the
> color you want based on the value of the cell.

I think the suggestion above is for just a cell.  For the whole row, you
would probably have to add a slot to render cells to all the treeview's
columns and check for the boolean in all the handlers.  There's probably
a better solution.

-- 
José



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