added BrowseItem class;
moved "zebra striping" from separate function to addColumn()
This commit is contained in:
parent
27b7e34dde
commit
da57a326cd
14 changed files with 811 additions and 51 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.7 $
|
||||
Version : $Revision: 1.8 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ZebraTreeView.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -83,37 +83,22 @@ ZebraTreeView :: appendColumn(
|
|||
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn)
|
||||
throw ()
|
||||
{
|
||||
/*
|
||||
ZebraCellRenderer* renderer = Gtk::manage(new ZebraCellRenderer);
|
||||
// a standard cell renderer; can be replaced with a ZebraCellRenderer
|
||||
Gtk::CellRendererText* renderer = Gtk::manage(new Gtk::CellRendererText);
|
||||
|
||||
// the constructor packs the renderer into the TreeViewColumn
|
||||
Gtk::TreeViewColumn* viewColumn = Gtk::manage(new
|
||||
Gtk::TreeViewColumn(title, *renderer) );
|
||||
|
||||
// and then we associate this renderer with the model column
|
||||
viewColumn->set_renderer(*renderer, modelColumn);
|
||||
|
||||
return append_column(*viewColumn);
|
||||
*/
|
||||
// instead of the above, we just do the simple-minded thing, for now
|
||||
return append_column(title, modelColumn);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Set the callback function for every column.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
ZebraTreeView :: setCellDataFunction(void) throw ()
|
||||
{
|
||||
std::list<Column*> columnList = get_columns();
|
||||
std::list<Column*>::iterator it;
|
||||
|
||||
for (it = columnList.begin(); it != columnList.end(); ++it) {
|
||||
(*it)->set_cell_data_func(
|
||||
*(*it)->get_first_cell_renderer(),
|
||||
// this cell data function will do the blue-gray zebra stripes
|
||||
viewColumn->set_cell_data_func(
|
||||
*renderer,
|
||||
sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) );
|
||||
}
|
||||
|
||||
// set_rules_hint(); // suggest coloring with alternate colors
|
||||
|
||||
return append_column(*viewColumn);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue