编程笔记:Editable Treeview Cell

一月 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 | 留下评论 | Trackback URL

Leave Your Comment

注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。

Page optimized by WP Minify WordPress Plugin

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