编程笔记:Editable Treeview Cell

January 12, 2009

I found that programming gtk+ plays a lot of tricks. I implemented "editable treeview cells" today in my program, after spending quite a while looking up for examples on Google. The most I wanted to say is that, the Gtk manual was detailed enough, but it never tells you how to do, which makes me so desperate sometimes......

The solution was written in a tutorial, http://scentric.net/tutorial/sec-editable-cells.html

there seems quite several GTK tutorials, but most of their contents were duplicated, though I always learn the tricks from them... ^_^

Note:

renderer = gtk_cell_renderer_text_new();
...
g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(COLUMN_NAME));

...

renderer = gtk_cell_renderer_text_new();
...
g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(COLUMN_YEAR_OF_BIRTH));

...

the "renderer" must be create several times in this trick, for a object couldn't carry the same property in different value twice, itn's it?

posted in GTK +, Programming by PT

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Page optimized by WP Minify WordPress Plugin

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org