Re: TreeView Questions
- From: Qball Cow <qball qball homelinux org>
- To: SkyRat23 aol com
- Cc: gtk-app-devel-list gnome org
- Subject: Re: TreeView Questions
- Date: 09 Jun 2003 10:47:09 +0200
On Mon, 2003-06-09 at 09:41, SkyRat23 aol com wrote:
Hi. I have recently begun porting one of my programs to GTK2 and have decided to use the TreeView instead
of the CList. Now it is much more difficult to learn how to properly use the TreeView than a CList and I
have a few things I cannot figure out.
1st
How does one change the color for the font of just a single row. I could use gtk_clist_set_foreground
before but now I am at a loss to figure it out.
The way I did it in my program was via a gtk_cell)renderer_text
property..
http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRendererText.html
if you look at the property's there you see you can set "foreground-gdk"
code:
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Priority", renderer,
"text" , PRIOSTR,"strikethrough", DONE,"foreground-gdk", COLOR, NULL);
(COLOR is an enum for the row with the color setting)
so I've added an GdkColor row to my gtk_(tree/list)_store.
and now I can set the color off every row in the list.
2nd
I need to catch double click signals from the user input on the treeview. I do this using a button press
event, I check for the double click by checking the event type. This works fine however because I catch
the button press signal, the row that the user clicks on is never selected (even on a sigle click). I
would like for it to be selected however. I was thinking the function gtk_selection_select_path could be
used b/c I have a path to the row however, what would/where would/how would I get the GtkTreeSelection that
the function requires.
I don't get this to work either.. (by letting youre callback function
return with FALSE you don't stop the signal). but the selection would
then take place AFTER whatever you did. and that isn't great either.
so can't help you here
If you would be so kind, please provide short (snippets) of code function calls etc. . . that I would use
and explain what is going on (most important!). I have been trying to understand the TreeView as a whole
by looking at the API however that has not helped me much to really understand it.
Thank you.
David Swiston
I hope I made a little bit of sence. and not to many typo's.
Qball
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]