NAME
Gapp::ComboBox - ComboBox Widget
OBJECT HIERARCHY
Traits
SYNOPSIS
# basic combo-box
Gapp::ComboBox->new(
values => [ '', 'Option1', 'Option 2', 'Option 3' ],
);
# in this example the combo is populated with array-refs
# the text is displayed to the user, and and the integer
# can be referenced for programmer user
Gapp::ComboBox->new(
values => [
[ 0, ' ' ],
[ 1, 'Option 1' ],
[ 2, 'Option 2' ],
[ 3, 'Option 3' ],
],
data_func => sub { $_->[1] },
);
# objects too
Gapp::ComboBox->new(
values => [
$object1,
$object2,
$object3
],
data_func => 'label',
);
PROVIDED ATTRIBUTES
- data_column
-
This is the column in the model to the ComboBox will reference by default. The values in the column will appear as options to the user. You can manipulate this value using the
data_func
attribute. - data_func
-
Use the
data_func
to manipulate how an entry in the combo is rendered. The value returned by this function will be displayed to the user.$_
is set to the value held in the model atdata_column
for your convienence. - model
-
If specified, sets the model of the
ComboBox
. - renderer
-
- isa Gapp::CellRenderer
- default Gapp::CellRenderer->new( gclass => 'Gtk2::CellRendererText', property => 'markup' );
Sets the renderer for the
ComboBox
. - values
AUTHORS
Jeffrey Ray Hallock <jeffrey.hallock at gmail dot com>
COPYRIGHT & LICENSE
Copyright (c) 2011-2012 Jeffrey Ray Hallock.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.