Re: [gtkmm] listview: setting textcolor in individual cells in th e same column
- From: bart <bart hakvoort castel nl>
- To: Christer Palm <palm nogui se>
- Cc: Murray Cumming Comneon com, gtkmm-list gnome org
- Subject: Re: [gtkmm] listview: setting textcolor in individual cells in th e same column
- Date: Fri, 17 Oct 2003 23:17:33 +0200
JAHOEE ;-) it is working!
I can't say i understand fully what i did, but i come close ;)
I'm a happy man, thanks for all the help guys!
relevant code==============================================
Gtk::TreeViewColumn* naamkolom = get_column(1);
Gtk::CellRenderer* cell_renderer =
naamkolom->get_first_cell_renderer();
Gtk::CellRendererText* cell_renderer_text =
dynamic_cast<Gtk::CellRendererText*>(cell_renderer);
if ( werknemer.status ) row[kolommen.kleur] = "#63AB63";
else row[kolommen.kleur] = "red";
naamkolom->add_attribute(cell_renderer_text->property_foreground(),
kolommen.kleur);
==============================================================================
grtz,
Bart
On Fri, 2003-10-17 at 17:37, Christer Palm wrote:
> Murray Cumming Comneon com wrote:
> >>From: Christer Palm [mailto:palm nogui se]
> >>myModelColumns is supposed to be your TreeModelColumnRecord,
> >>and color
> >>is a column in which you would put the color of each row (a
> >>string).
> >
> > If he's putting the color in a model column, instead of basing the color on
> > some calculation, why would he set the color in the callback. Why not just
> > connect the cell renderer's color property to that model column?
> > http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08s02.html#id2880753
> >
>
> Aha - yes why not?
> Didn't know you could do that...
>
> --
> Christer Palm
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]