manpagez: man pages & more
html files: pygtk
Home | html | info | man
gtk.ComboBoxEntry — a text entry field with a dropdown list (new in PyGTK 2.4)

Synopsis

class gtk.ComboBoxEntry(gtk.ComboBox, gtk.CellLayout):
    gtk.ComboBoxEntry(model=None, column=-1)
def set_text_column(text_column)
def get_text_column()
Functions

    def gtk.combo_box_entry_new_text()

Ancestry

+-- gobject.GObject
  +-- gtk.Object
    +-- gtk.Widget
      +-- gtk.Container
        +-- gtk.Bin
          +-- gtk.ComboBox
            +-- gtk.ComboBoxEntry

Implemented Interfaces

gtk.ComboBoxEntry implements gtk.Buildable gtk.CellLayout

gtk.ComboBoxEntry Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.ComboBox Properties

"text-column"Read-WriteThe column in the gtk.TreeModel to get the strings from.

gtk.ComboBoxEntry Style Properties

gtk.Widget Style Properties

gtk.ComboBox Style Properties

gtk.ComboBoxEntry Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

gtk.ComboBox Signal Prototypes

gtk.CellEditable Signal Prototypes

Description

Note

This widget is available in GTK+ 2.4 and PyGTK 2.4 and above.

The gtk.ComboBoxEntry is a replacement for the gtk.Combo. The gtk.ComboBoxEntry is subclassed from gtk.ComboBox and implements the gtk.CellLayout interface; refer to their descriptions for a number of useful methods and properties for managing the contents of a combo box entry. A gtk.ComboBoxEntry also contains a child gtk.Entry accessed by using the child attribute of the combo box entry:

  entry = comboboxentry.child

A gtk.ComboBoxEntry is created with the gtk.ComboBoxEntry() constructor. The constructor can also be called with the optional parameters model (a gtk.TreeModel - default None) and column (a number of a column in model - default 0). If no gtk.TreeModel is specified it can be added later with the set_model() method. The text column can be changed using the set_text_column() method. A new combo box entry is created and packed with a gtk.CellRendererText but no attribute mappings are set on the cell renderer.

Alternatively, the gtk.combo_box_entry_new_text() function creates a gtk.ComboBoxEntry with an associated gtk.ListStore model and the text column attribute mapping set to 0. In this combo box entry each list item is a text string that can be selected. The convenience methods gtk.ComboBox.append_text(), gtk.ComboBox.prepend_text(), gtk.ComboBox.insert_text() and gtk.ComboBox.remove_text() can be used to manage the contents of the gtk.ComboBoxEntry. Using the gtk.combo_box_entry_new_text() function is equivalent to:

  liststore = gtk.ListStore(gobject.TYPE_STRING)
  comboboxentry = gtk.ComboBoxEntry(liststore, 0)

Constructor

    gtk.ComboBoxEntry(model=None, column=-1)

model :

The gtk.TreeModel to associate with the combo box entry, or None

column :

The number of the column to use for setting the strings of the combo box entry.

Returns :

A new gtk.ComboBoxEntry.

Note

This constructor is available in PyGTK 2.4 and above.

Creates a new gtk.ComboBoxEntry that has a gtk.Entry as child and associated with the gtk.TreeModel specified by model and using the column of model specified by column to retrieve strings. If model was not specified it defaults to None but you can change the model using the gtk.ComboBox.set_model() method. If column was not specified it defaults to -1 meaning the text column is unset but you can change it using the set_text_column() method. Once the text column is set either in the constructor or using the set_text_column() method it cannot be changed. A ValueError exception is thrown if column is outside the range of column numbers for model.

Methods

gtk.ComboBoxEntry.set_text_column

    def set_text_column(text_column)

text_column :

A column in the associated gtk.TreeModel to use as the data source for the strings.

Note

This method is available in PyGTK 2.4 and above.

The set_text_column() method sets the "text-column" property to the value of tree_column only if the text column has not been set (that is, "text-column" is -1). The value of tree_column is the number of the tree model column used as the data source for the strings of the combo box entry.

gtk.ComboBoxEntry.get_text_column

    def get_text_column()

Returns :

The number of the column in the associated gtk.TreeModel used as the data source for the combo box entry.

Note

This method is available in PyGTK 2.4 and above.

The get_text_column() method returns the number of the gtk.TreeModel column that is used as the data source for the strings of the combo box entry.

Functions

gtk.combo_box_entry_new_text

    def gtk.combo_box_entry_new_text()

Returns :

A new gtk.ComboBoxEntry widget.

Note

This function is available in PyGTK 2.4 and above.

The gtk.combo_box_entry_new_text() function is a convenience function which constructs a new gtk.ComboBoxEntry, just displaying strings. If you use this function to create a combo box entry, you should only manipulate its gtk.TreeModel data source with the following gtk.ComboBox convenience methods: gtk.ComboBox.append_text(), gtk.ComboBox.insert_text(), gtk.ComboBox.prepend_text() and gtk.ComboBox.remove_text().

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.