Tcl::pTk::ttkBrowseEntry - BrowseEntry compatible wrapper for ttkCombobox
use Tcl::pTk; use Tcl::pTk::ttkBrowseEntry; $b = $frame->ttkBrowseEntry(-label => "Label", -variable => \$var, -labelPack => [-side => 'left']); $b->insert("end", "opt1"); $b->insert("end", "opt2"); $b->insert("end", "opt3"); ... $b->pack;
Tcl::pTk::ttkBrowseEntry is a wrapper around the Tile widget ttkCombobox that is compatible with Tcl::pTk::BrowseEntry. It is provided for a quick upgrade of existing code to use the newer Combobox widget.
In addition to the options of the parent widget, this widget recognizes the following options:
Optional name of a label to include for the browseEntry.
Optional Array-ref of information used to pack the optional label.
This option is provided for compatibility with BrowseEntry, but is ignored.
This option is provided for compatibility with BrowseEntry, but is ignored. (The Combobox widget always sets its listwidth the same as the width of the entry)
Specifies a function to call when a selection is made in the popped up listbox. It is passed the widget and the text of the entry selected. This function is called after the entry variable has been assigned the value.
Like -browsecmd, but the callback is called with the listbox index instead of the selected value.
-browsecmd
Set the -takefocus option of the button subwidget. This option is mapped to the -takefocus option of the comboBox widget.
-takefocus
Specifies the list of choices to pop up. This is a reference to an array of strings specifying the choices.
Any options that start with 'label' (e.g. -labelBackground, -labelFont) are provided for compatibility with BrowseEntry, but are ignored.
Specifies the function to call when the button next to the entry is pressed to popup the choices in the listbox. This is called before popping up the listbox, so can be used to populate the entries in the listbox.
Set the height of the listbox. This option is mapped to the -height option of the Combobox.
-height
Specifies one of three states for the widget: normal, readonly, or disabled.
Specifies the variable in which the entered value is to be stored.
Inserts the text of string at the specified index. This string then becomes available as one of the choices.
Deletes items from index1 to index2.
gets items from index1 to index2. This is there for compatibility with BrowseEntry.
Get the current selected choice. This directly maps to the get method of the combobox
To install Tcl::pTk, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tcl::pTk
CPAN shell
perl -MCPAN -e shell install Tcl::pTk
For more information on module installation, please visit the detailed CPAN module installation guide.