I have a combobox widget in python that I would like to be able to choose multiple items, but I’m starting to think this is not possible. I see that it is possible on using Gtk.TreeView() by setting the mode to multiple. Is there a way to get a combobox to do this? If no, can a treeview be placed inside a combobox and if so how (short coding example, please)? I’m using GTK3, but I could probably translate it from a GTK2 example.
I have a combobox widget in python that I would like to be able
Share
After much research, I think it is simply a limitation of the combobox that it can only hold one item. So, the answer is:
Yes, a combobox can be set up to select multiple (if it has a TreeView in it)
and, thus,
Yes, a TreeView can be placed inside a ComboBox.
BUT, it doesn’t behave correctly as the ComboBox acts as a container with the TreeView always visible, not just when activating the ComboBox. It can be set to select multiple useing Gtk.TreeSelection (gotten from Gtk.Treeview.get_selection()).
Here is the code:
I’m going to mess around with hiding and showing the treeview with activation of the combobox. I’ll let you know how it goes.