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

Rob Groen robgr at xs4all.nl
Fri May 20 19:35:12 CEST 2016


On 20-05-16 17:43, Nicolas Soubeiran wrote:
> Sorry, for my 2nd point; I didn't read enough you first mail. My 
> apologies.
> Then like said Dmitry A. Kazakov, if you do not want to use the 
> underlying model to store the editability of the cell, you have to use 
> Set_Cell_Data to set the editability property. FWIW : it is more 
> efficient to map property of tree model to an attribute of a treeview 
> column cell than use the Set_Cell_Data subprogram since Set_Cell_Data 
> will be called each time the treeview has to be refreshed (e.g on 
> mouse hover)
> regards
Ok, will take this into account
> 2016-05-20 13:46 GMT+02:00 Nicolas Soubeiran 
> <nicolas.soubeiran at gmail.com <mailto:nicolas.soubeiran at gmail.com>>:
>
>     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
>
Thanks, will try 2nd solution first (quickest) and will try (as an 
exercise :-)) the 1st when more time is avalaible. Thanks
Regards. Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20160520/6079286f/attachment.html>


More information about the gtkada mailing list