gtk.ComboBoxText
Prev | The gtk Class Reference | Next

## gtk.ComboBoxText

gtk.ComboBoxText — A simple, text-only combo box (new in PyGTK 2.24)

## Synopsis

    class gtk.ComboBoxText(gtk.ComboBox):
        gtk.ComboBoxText()
        def append_text(text)
        def insert_text(position, text)
        def prepend_text(text)
        def remove(position)
        def get_active_text()

          Functions

              def gtk.combo_box_text_new_with_entry()

## Ancestry

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

## Implemented Interfaces

`gtk.ComboBoxText` implements `gtk.Buildable` `atk.ImplementorIFace` `gtk.CellEditable` `gtk.CellLayout`

## gtk.ComboBoxText Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.ComboBox Properties

## gtk.ComboBoxText Style Properties

gtk.Widget Style Properties

gtk.ComboBox Style Properties

## gtk.ComboBoxText Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

gtk.CellEditable Signal Prototypes

gtk.ComboBox Signal Prototypes

## Description

### Note

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

A `gtk.ComboBoxText` is a simple variant of `gtk.ComboBox` that hides the model-view complexity for simple text-only use cases.

## Constructor

        gtk.ComboBox()

Returns : | A new `gtk.ComboBoxText`.

### Note

This constructor is available in PyGTK 2.24 and above.

Creates a new `gtk.ComboBoxText`, which is a `gtk.ComboBox` just displaying strings.

## Methods

### gtk.ComboBoxText.append_text

        def append_text(text)

`text` : | A string.

### Note

This method is available in PyGTK 2.24 and above.

The `append_text`() method appends the string specified by `text` to the list of strings stored in the combo box `gtk.ListStore`.

### gtk.ComboBoxText.insert_text

        def insert_text(position, text)

`position` : | A model index where the text should be inserted.
`text` : | A string.

### Note

This method is available in PyGTK 2.24 and above.

The `insert_text`() method inserts the string specified by `text` in the combo box `gtk.ListStore` at the index specified by `position`.

### gtk.ComboBoxText.prepend_text

        def prepend_text(text)

`text` : | A string.

### Note

This method is available in PyGTK 2.24 and above.

The `prepend_text`() method prepends the string specified by `text` to the list of strings stored in the `gtk.ListStore` associated with the combo_box.

### gtk.ComboBoxText.remove

        def remove(position)

`position` : | Index of the item to remove.

### Note

This method is available in PyGTK 2.24 and above.

The `remove_text`() method removes the string at the index specified by `position` in the associated `gtk.ListStore`.

### gtk.ComboBoxText.get_active_text

        def get_active_text()

Returns : | The currently active text.

### Note

This method is available in PyGTK 2.24 and above.

The `get_active_text`() method returns the currently active string or `None` if no entry is selected.

## Functions

### gtk.combo_box_text_new_with_entry

        def gtk.combo_box_text_new_with_entry()

Returns : | A new `gtk.ComboBoxText`.

### Note

This function is available in PyGTK 2.24 and above.

The `gtk.combo_box_new_text`() function creates a new `gtk.ComboBoxText`, which is a `gtk.ComboBox` just displaying strings. The combo box created by this function has an entry.

Prev | Up | Next
gtk.ComboBoxEntry | Home | gtk.Container