Erikson Souza
Erikson Souza

Reputation: 73

Gtk Combobox select multiple options

I'm using Python with GTK, and I need to select more than one option in the ComboBox widget, but after searching the documentation, apparently it is not possible.

Does anyone know what I can do this?

Upvotes: 2

Views: 891

Answers (2)

user7851115
user7851115

Reputation:

For anyone needing multiple selection with GTK 2 specifically, you can refer to the answer I wrote on a different post over here.

The idea is to use a TreeView and change its associated TreeSelection:

tree_view.get_selection().set_mode(gtk.SELECTION_MULTIPLE)

and it looks like this (full MWE here):

A user interface with a list showing multiple elements selected

Upvotes: 1

liberforce
liberforce

Reputation: 11454

When you don't know which widget can get the work done, give a look at the widget gallery of the GTK+ documentation. From the screenshots, GtkListBox looks like a good candidate for what you want to do, as you can have checkboxes for each item, meaning you can have multiple selection.

Upvotes: 2

Related Questions