Re: Conversion GtkCTree in GTK 1.2 to GtkTreeView in GTK 2
- From: Arno <dark-arno ifrance com>
- To: "Shahms E. King" <shahms shahms com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Conversion GtkCTree in GTK 1.2 to GtkTreeView in GTK 2
- Date: Thu, 11 Jul 2002 09:51:07 +0200
First, thank you for you answer, I will go to test it.
Shahms E. King wrote:
On Wed, 2002-07-10 at 15:50, Arno wrote:
- First I want to have dot line with rounded expansion like in my
application and not a triangle.
Thankfully, you can't. If I remember the why correctly, it's because
this kind of thing shouldn't be up to individual apps, but instead the
theme should be in charge of it. Although, I don't know if it's
modifiable even at that level at this point though. All in the name of
consistancy my boy.
So if I understand good, it's imppossible to have a dot line. I can't
modify the animation with the triangle :(
- I don't know how I could add a pixmap, at the begin of the line like
in the screenshot. I think to use : gtk_cell_renderer_pixbuf_new(); but
I create a new colum and not insert a pixmap at the beginning of the line.
first, create the column, then create a renderer, then pack the renderer
into the column.
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer);
or you can just do the gtk_tree_view_column_new_with_attributes (...);
with the first renderer and pack_start() the second.
Okay, in fact we create the colum first then we add the element in the
colum. But before I do this :
renderer = gtk_cell_renderer_pixbuf_new();
column = gtk_tree_view_column_new_with_attributes ("image",
renderer,
"pixbuf", PIXBUF_COLUM,
"pixbuf_expander_open", PIXBUF_COLUM,
"pixbuf_expander_closed", PIXBUF_COLUM,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Author", renderer,
"text", AUTHOR_COLUMN,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
You said that I can use gtk_tree_view_column_new_with_attributes only
with the first render so pixbuf in my sample. But how could I add my
attributes for the text if use only gtk_tree_view_colum_pack_start ?
I have also an other question : Wath type of element must I use in my
model ? Before I use :
store = gtk_tree_store_new (N_COLUMNS,
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
G_TYPE_STRING);
but now, the two colums make only one colum so I don't know the type.
- To finish, I see the function : g_object_set to change the color of
and object, but when I add a line, I use : gtk_tree_store_set and I
don't know how I could get a cell of the colum.
Thank you.
Arno
I'm not exactly sure what you're asking with the last question here.
gtk_tree_store_set is just about setting the data that will be rendered,
you need to map that to attributes of the cell renderer using
gtk_tree_view_column_add_attribute() or
gtk_tree_view_column_set_attributes()
In fact, I want that all my cell of the TreeView use the "fixed" font
and I want to use differentes color in the first colum (like you can see
in my screenshot : http://www.arnoraes.freesurf.fr/Forum/tree.png).
--Shahms
Thank you
Arno
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]