Re: GtkTreeView possibilities to set text propertys on individual columns



After some look at the gtk-demo and Havoc and jrb's replys it seems like my

third test works.

But some other API related problems came up (yes this is gtk-devel related
:-)

1. I have setup three tree_view_columns that is using the same cell
renderer:
and one mapped cell property ("foreground") like this:

  cell = gtk_cell_renderer_text_new ();
  column = gtk_tree_view_column_new_with_attributes ("Source/Binary", cell,
"text", 0, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (app->treeview), column);

  column = gtk_tree_view_column_new_with_attributes ("Linenum", cell,
"text", 1, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (app->treeview), column);

  column = gtk_tree_view_column_new_with_attributes ("Message/commands",
cell, "text", 2,"foreground",3, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (app->treeview), column);

And setup a new listitem like:

  gtk_tree_store_set (app->model, &iter, 0,"column 1", 1,"column 2", 2,
"column 3", 3, "#ff0000", -1); /* items should be red colored */

Now if I am not want to set the foreground (means use default color):

  gtk_tree_store_set (app->model, &iter, 0,"column 1", 1,"column 2", 2,
"column 3", -1)   /* don't pass last argument */

With this code I get a warning passing NULL to gdk_color_parse should we
really 
take this as an error/warning?  How about just set it to default property
if you 
don't pass all arguments to tree_store_set?

2. gtk_tree_store_set takes (column, data,....) as arguments and
gtk_tree_view_column_new_with_attributes takes data, column
how about the same for both (column, data,.....) ?

Greats

M.H.




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