John Cerney > Tcl-pTk > Tcl::pTk::ttkBrowseEntry

Download:
Tcl-pTk-0.85.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.85   Source  

NAME ^

Tcl::pTk::ttkBrowseEntry - BrowseEntry compatible wrapper for ttkCombobox

SYNOPSIS ^

 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;

DESCRIPTION ^

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.

OPTIONS ^

In addition to the options of the parent widget, this widget recognizes the following options:

-label

Optional name of a label to include for the browseEntry.

-labelPack

Optional Array-ref of information used to pack the optional label.

-autolimitheight

This option is provided for compatibility with BrowseEntry, but is ignored.

-arrowimage

This option is provided for compatibility with BrowseEntry, but is ignored.

-autolimitheight

This option is provided for compatibility with BrowseEntry, but is ignored.

-autolistwidth

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)

-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.

-browse2cmd

Like -browsecmd, but the callback is called with the listbox index instead of the selected value.

-buttontakefocus

Set the -takefocus option of the button subwidget. This option is mapped to the -takefocus option of the comboBox widget.

-choices

Specifies the list of choices to pop up. This is a reference to an array of strings specifying the choices.

-colorstate

This option is provided for compatibility with BrowseEntry, but is ignored.

-label*

Any options that start with 'label' (e.g. -labelBackground, -labelFont) are provided for compatibility with BrowseEntry, but are ignored.

-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.

-listheight

Set the height of the listbox. This option is mapped to the -height option of the Combobox.

-listwidth

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)

-state

Specifies one of three states for the widget: normal, readonly, or disabled.

-style

This option is provided for compatibility with BrowseEntry, but is ignored.

-variable

Specifies the variable in which the entered value is to be stored.

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.

get(index1, index2)

gets items from index1 to index2. This is there for compatibility with BrowseEntry.

choiceget

Get the current selected choice. This directly maps to the get method of the combobox

syntax highlighting: