success with GtkTreeView



Ok, you can ignore my previous message. I did get it work by creating
another project (gtk2 only) and copy/paste the relevant code bits in.

The good news is I used Glade to create a GtkTreeView object. I then
grabbed a pointer to that object using lookup_widget, created a
GtkListStore and set the GtkTreeView up to use that list store. I then
started creating columns and adding them as showin in "Tree and List
Widget" in the Gtk+ 2.0 API docs on the website, and also some help from
some of you (special thanks to Harring Figueirdo on the Glade-Users
list -- hmm, Figueirdo, is that Portuguese?)

However, one of the things I wanted to try was to set the heading text
to be red, like shown in the API reference, but for some reason it
doesn't work. See for yourself at:

http://www.duckwing.ca/screenshots/gtktreeview.jpg

Notice the code behind "window1" shows creating the cell renderer and
setting the text to red using g_object_set:

renderer = gtk_cell_renderer_text_new();
g_object_set( G_OBJECT(renderer), "foreground", "red", NULL);

but when I create the column and append it to the view, the text is not
red like I *thought* it should be:

column = gtk_tree_view_column_new_with_attributes("Shift", 
    renderer, "text", SHIFT_COLUMN, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(theTreeView), column);

This is pretty much straight from the API Reference docs. Any ideas as
to why this is happening? Do the headings for the columns maybe not
allow this?


-- 
 .''`.      Carl B. Constantine
: :' :     duckwing duckwing ca
`. `'    GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom



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