[gtkada] showing and editing different types in same treeview column

Nicolas Soubeiran nicolas.soubeiran at gmail.com
Fri May 20 13:46:58 CEST 2016


Hello,
If you want to set your cell editable or not use the "Editing_Properties"
of Gtk.Cell_Renderer.

For edition you have 2 solutions :
1. You implement your own Gtk.Cell_Renderer_Text, and you use the
Gtk.Cell_Editable interface to customize edition on the cell : see
Start_Editing (for displaying the "good" widget), On_Editing_Done (when
user validate the value) and Remove_Widget (when user cancel action)
subprograms.
2.  add 3 cellrenderers in your Treeview Column : Gtk.Cell_Renderer_Spin
(for integer), Gtk.Cell_Renderer_Combo (for enum), and
Gtk_Cell_Renderer_Text (for string) and use the "visible" property to show
the "good" cell_renderer and hide the 2 others.

The first solution is the cleanest, but if you lack time the second will
fit your need.
regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20160520/1f8cc877/attachment.html>


More information about the gtkada mailing list