13. ComboBox — Python GTK+ 3 Tutorial 3.4 documentation

A Gtk.ComboBox allows for the selection of an item from a dropdown menu. They are preferable to having many radio buttons on screen as they take up less room. If appropriate, it can show extra information about each item, such as text, a picture, a checkbox, or a progress bar.Gtk.ComboBox is very similar to Gtk.TreeView, as both use the model-view pattern; the list of valid choices is specified in the form of a tree model, and the display of the choices can be adapted to the data in the model by using cell renderers. If the combo box contains a large number of items, it may be better to display them in a grid rather than a list. This can be done by calling Gtk.ComboBox.set_wrap_width().The Gtk.ComboBox widget usually restricts the user to the available choices, but it can optionally have an Gtk.Entry, allowing the user to enter arbitrary text if none of the available choices are suitable. To do this, use one of the static methods Gtk.ComboBox.new_with_entry() or Gtk.ComboBox.new_with_model_and_entry() to create an Gtk.ComboBox instance.For a simple list of textual choices, the model-view API of Gtk.ComboBox can be a bit overwhelming. In this case, Gtk.ComboBoxText offers a simple alternative. Both Gtk.ComboBox and Gtk.ComboBoxText can contain an entry.

Source: 13. ComboBox — Python GTK+ 3 Tutorial 3.4 documentation

13. ComboBox — Python GTK+ 3 Tutorial 3.4 documentation was last modified: July 13th, 2017 by Jovan Stosic