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?
发表评论