widget_listentry(3tk) | widget::listentry widget | widget_listentry(3tk) |
widget_listentry - widget::listentry widget
package require Tcl 8.5
package require Tk 8.5
package require widget::listentry ?0.1.2?
package require widget::validator ?0.1?
package require widget::scrolledwindow
package require snit
package require tooltip
package require img::png
package require msgcat
widget::listentry pathname ?options?
widgetCmd destroy
widgetCmd configure
widgetCmd configure option value ...
widgetCmd configure option
widgetCmd cget option
{*}cmdprefix get
{*}cmdprefix set values
{*}cmdprefix text errvar
{*}cmdprefix text
{*}cmdprefix cookievar
This package provides a megawidget for the interactive entry of ordered and unordered lists. For a simpler and more restricted megawidget please see the package widget::listsimple.
The widget class supports a single command, for the creation of widgets.
For details on the available options please see section Widget Options.
The result of the command is the pathname of the new widget.
All widget instances supported the following methods.
The result of the command is the empty string.
For details on the available options please see section Widget Options.
Note that it is not possible to change the construction-time only options.
For details on the available options please see section Widget General Options.
The result of the command is the empty string.
For details on the available options please see section Widget Options.
This section explains all the options available to instances of widget::listentry. Please note that a few of the options can be set only at instance construction time. The majority of the options can however be set both during construction- and runtime.
The default is false, indicating an unordered list.
The default is false, indicating that duplicates are not allowed.
If specified the widget will use a combobox instead of a plain entry field and fill its list during widget construction using the data delivered by this callback. The callback will be further invoked whenever a new value is entered into the main list, to save the extended list of predefined values.
The signature of this callback is
It will be invoked once, during widget construction, to load the list of predefined strings a user may enter.
The return value of the callback is ignored.
This form is invoked whenever the user entered a new string into the main list. The order of strings in values represents the order used to show them in the combobox's list.
The widget expects that the callback returns a boolean value, where true indicates that text is valid.
Please note that the widget will prevent the entry of duplicate values into the main list, regardless of the validity of the input otherwise. This is in keeping with that this widget is meant for the entry of unordered lists, essentially a set of strings.
The use case for this callback is essentially input normalization. The most simple case of such would be, for example the use of
string tolower
The widget expects that the callback returns the transformed string.
The default is to not transform the entered strings.
The widget expects that the callback returns a list of strings, which are then added to the list, modulo validity and duplicate checks.
By default there is no browse callback and no button shown.
The default is normal.
The default is 20.
All options taking a string argument influence the various labels shown, with the -skin-tip-* options influencing the tooltips shown on hovering the over various parts in particular.
All the strings are run through msgcat first, enabling text localization through message catalogs. The default values are keys into the message catalogs which are part of the package itself.
The options taking images modify the images shown on the buttons for adding and removing elements of the list. They default to the PNG images distributed with the package itself.
The single option taking a color value modifies the color used to highlight invalid data entered into the internal entry field of the widget. This option defaults to yellow.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category widget::listentry of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation.
data entry lists, data entry ordered list, data entry set of strings, data entry unordered list, list entry panel, set entry panel, widget
0.1.2 | tklib |