Tkinter insert a Combobox inside a Treeview widget Tkinter insert a Combobox inside a Treeview widget tkinter tkinter

Tkinter insert a Combobox inside a Treeview widget


The treeview widget doesn't support embedded widgets. The values for the values attribute are treated as strings.


By default, a Treeview is a static display of a forest of lists of strings. However, with work, after carefully reading Treeview references, one can make a Treeview fairly interactive. For this question, I would bind left click to an event handler that compares the mouse x,y to the bounding box (.bbox) for the units attribute cell. If in the box, display a Combobox, initialized with the current value (such as 'flops'), directly on top of the units attribute cell.

Tkinter.ttk Treeview reference and Tcl/tk treeview reference

Of course, it might be easier to put the Treeview in a frame with with a separate Combobox.