Re: [gtkmm] TreeView/ListStore



Thank you, but doesn't that change the colour of the whole column? I need to change the colour of a whole row. As far as I understand a CellRenderer is related to how a column is rendered in all the rows, am I right? How to change that behaviour for a particular row? What I'm trying to achieve is one row in red and the next in blue, for example.

Garriss, Michael wrote:

I'm really busy today so this is just a short hint:

// m_color amd m_visible are non-visible TreeViewColumns
CellRendererText * pRenderer = manage( new CellRendererText( ) );
m_tree_view.append_column( col.m_name, *pRenderer );
TreeViewColumn * pColumn = m_tree_view.get_column( col_num );
pColumn->add_attribute( pRenderer->property_visible(), m_visible );
pColumn->add_attribute( pRenderer->property_text( ), tcol );
pColumn->add_attribute( pRenderer->property_foreground( ), m_color );
pColumn->set_visible( );

----Original Message-----
From: Leandro Fanzone [mailto:leandro hasar com]
Sent: Friday, November 15, 2002 7:21 AM
To: gtkmm-list gnome org
Subject: [gtkmm] TreeView/ListStore


Hello. I'm currently porting my gtkmm-1.2.x application to the new 1.3.x and to my dismay, I find that there is no clist in there anymore. I'm told that CList is replaced with TreeView using a ListStore model. So far, so good. The new widget is extremely complex, compared with the old one. Taking a look at the examples, I worked out some things, but others remain obscure. In this case, I can't find a way to change the style of a given row. In my application, different items show different colours, or even different fonts. That could be done in a CList using set_style on the row I would want to change, but I can't seem to find such device on this widget. I was taking a look at the CellRenderer interface, but it seems to be related to the style of a whole column, not a row. Is this a GTK+ question, or can you give me some hint?
Thank you in advance,

Leandro Fanzone

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list





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