Torsten Schönfeld > Gtk2-1.180 > xs/GtkComboBoxEntry.xs

Download:
Gtk2-1.180.tar.gz

Annotate this POD

CPAN RT

New  4
Open  4
View Bugs
Report a bug
Source   Latest Release: Gtk2-1.203

SYNOPSIS ^

  # the easy way
  $combo_box_entry = Gtk2::ComboBoxEntry->new_text;
  foreach (qw(one two three four five)) {
      $combo_box_entry->append_text ($_);
  }

  # or the powerful way.  there always has to be at least
  # one text column in the model, but you can have anything
  # else in it that you want, just like Gtk2::ComboBox.
  $combo_box_entry = Gtk2::ComboBoxEntry->new ($model, $text_index);

  # to mess with with entry directly, get the child:
  $current_text = $combo_box_entry->child->get_text;

DESCRIPTION ^

A ComboBoxEntry is a widget that allows the user to choose from a list of valid choices or enter a different value. It is very similar to a ComboBox, but displays the selected value in an entry to allow modifying it.

The ComboBoxEntry has a Gtk2::Entry as its child. To get or set the currently-displayed text, just manipulate the entry normally.