Re: [gtkmm] TreeView/ListStore



If you still don't know how to do this you could have a look at two of my source files:

plothistory.h
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gspeakers/gspeakers2/src/plothistory.h?rev=HEAD&content-type=text/vnd.viewcvs-markup

plothistory.cc:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gspeakers/gspeakers2/src/plothistory.cc?rev=HEAD&content-type=text/vnd.viewcvs-markup

In bottom of the cc-file i do something like people have tried to explain to you. Maybe it is easier if you have real working source code to look at.

Mail me if you have problems understanding my code.

/Daniel

On Fri, 15 Nov 2002 12:36:43 -0300
Leandro Fanzone <leandro hasar com> wrote:

> Thank you, I quite don't understand it yet, but I'll study the subject 
> and your example. Sorry if I misunderstood it first, but this is overly 
> complex for me, I don't get attributes, renderers, columns, this is all 
> way different to the old CList, and I don't seem to grasp its inner 
> workings.
> Thank you again, I go back to study
> 
> Leandro.
> 
> Garriss, Michael wrote:
> 
> >Yes, you need to call add_attribute on every column and then set the color
> >you want that row into that invisible column on that row like murry
> >described.  Like I said, it was just a hint....
> >
> >-----Original Message-----
> >From: murrayc t-online de [mailto:murrayc t-online de]
> >Sent: Friday, November 15, 2002 8:14 AM
> >To: Leandro Fanzone
> >Cc: Garriss, Michael; gtkmm-list
> >Subject: Re: [gtkmm] TreeView/ListStore
> >
> >
> >On Fri, 2002-11-15 at 16:11, Leandro Fanzone wrote:
> >  
> >
> >>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.
> >>    
> >>
> >
> >But a CellRender can do different things for each row. The example has
> >an invisible color column. The row will be blue if that row's color
> >column value is "blue" (or whatever the format/type really needs to be).
> >If you need this capability on every View column then you should use
> >that technique for every column.
> >
> >  
> >
> >>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
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>_______________________________________________
> >>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]