Re: drawing stuff inside the TreeView

Tim, thank you VERY much for the answer! Just one
question. You said:

use ready-made circles in form of GdkPixbufs. 

where do I find those ready-made icons? Are you
refering to GTK stock items? I can't seem to find
other pixbuf icons from the reference manual. Could
you point them to me please?

Thanks, Alexei.

--- Tim Müller <zen18864 zen co uk> wrote:

On Wednesday 22 June 2005 17:18, Alexei D wrote:

  I need to create a Tree widget that has 1
Each row in the column should contain a small
and some text (filename) next to it. The color of
circle represents the file type. I have to draw
circles myself with gdk_draw_arc(). But I cannot
how I can draw something inside the Tree Column.

  Then, how do I pack the circle AND text inside 1
column? Is it possible to put 2 things in 1

The easiest way is to pack a pixbuf renderer with a
text renderer into the 
same tree view column and use ready-made circles in
form of GdkPixbufs. Just 
add another column of type GDK_TYPE_PIXBUF to your
list store for that and 
connect the 'pixbuf' property of the pixbuf renderer
to the column number of 
that model column via tree view column attributes
(just like you do with the 
'text' property for the text renderer).

Alternatively, if you really must use
gdk_draw_arc(), you can write a custom 
cell renderer, but that's a lot more work and
probably slower as well.


Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football

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