NAME
Tk::BrowseEntry - entry widget with popup choices.
SYNOPSIS
use Tk::BrowseEntry;
$b = $frame->BrowseEntry(-label => "Label", -variable => \$var);
$b->insert("end", "opt1");
$b->insert("end", "opt2");
$b->insert("end", "opt3");
...
$b->pack;
DESCRIPTION
BrowseEntry is a poor man's ComboBox. It may be considered an enhanced version of LabEntry which provides a button to popup the choices of the possible values that the Entry may take. BrowseEntry supports all the options LabEntry supports except -textvariable. This is replaced by -variable. Other options that BrowseEntry supports.
- -listwidth
-
Specifies the width of the popup listbox.
- -variable
-
Specifies the variable in which the entered value is to be stored.
- -browsecmd
-
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.
- -listcmd
-
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.
METHODS
- insert(index, string)
-
Inserts the text of string at the specified index. This string then becomes available as one of the choices.
- delete(index1, index2)
-
Deletes items from index1 to index2.
BUGS
BrowseEntry should really provide more of the ComboBox options.
AUTHOR
Rajappa Iyer rsi@earthling.net
This code was inspired by ComboBox.tcl in Tix4.0 by Ioi Lam and bears more than a passing resemblance to ComboBox code. This may be distributed under the same conditions as Perl.