[pygtk] Editable text fields in TreeView with defined width

Jeffrey Barish jeff_barish at earthlink.net
Sun Feb 10 10:17:31 WST 2008


I know that I can set editable to True to make it possible for the user to
edit the contents of a CellRendererText.  Is it possible to make the cell
look like an Entry?  What I need specifically is the ability to specify the
width of the field in which text can be entered and to provide visual
feedback as to the width of the field.  The width of the field in each row
can be different, so setting column width is not sufficient.

My current implementation uses ad hoc code that puts a Label and an Entry in
a hbox and then stacks them in a vbox.  I could make this code a custom
Widget.  I also need a companion model.  I started wondering about the
possibility of using a TreeStore rather than creating my own model, but
then I thought that if I am using a TreeStore, why not use a TreeView with
a custom renderer?  A custom renderer seems difficult because I cannot
simply put Widgets in rows of a TreeView.  Assuming that each row is a text
label and an entry, would it be difficult to create such a renderer?
-- 
Jeffrey Barish



More information about the pygtk mailing list