Gtk2::Ex::ComboBoxBits -- misc Gtk2::ComboBox helpers
use Gtk2::Ex::ComboBoxBits;
$path = Gtk2::Ex::ComboBoxBits::get_active_path ($combobox)
Return a Gtk2::TreePath to the active item in $combobox, or undef if empty or no model or nothing active.
Gtk2::TreePath
$combobox
undef
Gtk2::Ex::ComboBoxBits::set_active_path ($combobox, $path)
Set the active item in $combobox to the given Gtk2::TreePath position. If $path is empty or undef or there's no such row in the model then $combobox is set to nothing active.
$path
Some versions of ComboBox have a feature where if there's no model in $combobox then a toplevel active item is remembered ready for a model set later. Not sure if that's documented, but set_active_path tries to cooperate by using set_active for toplevels, and set_active_iter for sub-rows (which don't get the same remembering).
set_active_path
set_active
set_active_iter
The following are for use on a simplified "text" ComboBox as created by Gtk2::ComboBox->new_text().
Gtk2::ComboBox->new_text()
$str = Gtk2::Ex::ComboBoxBits::set_active_text ($combobox, $str)
$combobox must be a simplified "text" type ComboBox. Set the entry $str active.
$str
The corresponding "get" is $combobox->get_active_text(), see Gtk2::ComboBox.
$combobox->get_active_text()
$iter = Gtk2::Ex::ComboBoxBits::find_text_iter ($combobox, $str)
Return a Gtk2::TreeIter which is the row for $str in a text style combobox. If $str is not in $combobox then return undef.
Gtk2::TreeIter
Nothing is exported by default, but the functions can be requested in usual Exporter style,
Exporter
use Gtk2::Ex::ComboBoxBits 'set_active_text';
This can be handy if using set_active_text many times. Gtk2::Ex::ComboBox::Text imports it to use as an object method.
set_active_text
Gtk2::Ex::ComboBox::Text
There's no :all tag since this module is meant as a grab-bag of functions and to import as-yet unknown things would be asking for name clashes.
:all
http://user42.tuxfamily.org/gtk2-ex-comboboxbits/index.html
Copyright 2010, 2011 Kevin Ryde
Gtk2-Ex-ComboBoxBits is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Gtk2-Ex-ComboBoxBits is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Gtk2-Ex-ComboBoxBits. If not, see http://www.gnu.org/licenses/.
To install Gtk2::Ex::ComboBoxBits, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gtk2::Ex::ComboBoxBits
CPAN shell
perl -MCPAN -e shell install Gtk2::Ex::ComboBoxBits
For more information on module installation, please visit the detailed CPAN module installation guide.