widget_listentry(n)
π widget_listentry(n) π β the widget::listentry widget, bestie, no cap
okay so this is the manual page for widget_listentry, a.k.a. the widget::listentry widget. Itβs giving list-entry megawidget energy, and weβre going through every option, signature, default, and caveat together, periodt. π«Ά
πΈ NAME πΈ
widget_listentry - widget::listentry widget β thatβs the name, thatβs the vibe. π
β¨ SYNOPSIS β¨
First up, the requires and command shapes. These are literal, so Iβm keeping them exactly as written, no editing, no βfixing,β none of that:
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
The ?0.1.2? and ?0.1? are literally part of the synopsis, iykyk. π
π¦ DESCRIPTION π¦
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. Thatβs the whole description, and honestly it understood the assignment. β¨
π CLASS API π
The widget class supports a single command, for the creation of widgets. One command, main character energy, we love to see it. π
widget::listentry pathname ?options?β this command creates and configures new instances of the widget. For details on the available options please see section Widget Options. The result of the command is the pathname of the new widget. Slay. π
π INSTANCE API π
The original says βAll widget instances supported the following methods.β Iβm keeping the whole list intact, bestie: π«Ά
widgetCmd destroyβ this method destroys the widget. Any further access to the widget will generate errors. The result of the command is the empty string.widgetCmd configureβ this method comes in three variants. This variant here returns a list containing the current configuration of the widget, i.e. the values for all options. For details on the available options please see section Widget Options.widgetCmd configure option value ...β this method comes in three variants. This variant here reconfigures the widget, setting the specified options to the given values. 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.widgetCmd configure optionβ this method comes in three variants. This variant here is an alias for the methodcgetbelow and identical to it.widgetCmd cget optionβ this method returns the current value of the specified option. For details on the available options please see section Widget Options.
π 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. So yes, some are locked after birth, and some are glow-up-able whenever. π
π WIDGET CONSTRUCTION-TIME ONLY OPTIONS π
Construction-time only means construction-time only, bestie. The page says it is not possible to change construction-time only options later, so set them with intention. π
-ordered booleanβ this option tells the new widget instance whether the list it manages is ordered or not. If it is ordered, the widget will show buttons with which the selected entries can be moved around, editing the order. The default isfalse, indicating an unordered list.-allow-duplicates booleanβ this option tells the new widget instance whether we are allowed to add a string to the list multiple times, or not. The default isfalse, indicating that duplicates are not allowed.-values cmdprefixβ this option specifies a callback for the management of a predefined list of strings a user may enter. 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 signatures of this callback are:{*}cmdprefix getβ in this form the callback is expected to return a list of strings. The strings are loaded into the list of the internal combobox for quick access by the user. It will be invoked once, during widget construction, to load the list of predefined strings a user may enter.{*}cmdprefix set valuesβ in this form the callback is given a list of new strings and expected to save them somewhere for future use. 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 invaluesrepresents the order used to show them in the comboboxβs list.
-validate cmdprefixβ this option specifies a callback which is invoked after every change of the contents of the internal entry field. The signature of this callback is:{*}cmdprefix text errvarβ wheretextis the string to validate, anderrvarthe name of a variable the callback can store an error message into when it detects invalid data. The widget expects that the callback returns a boolean value, where true indicates thattextis valid.
The default validation, when no callback was specified, will treat the empty string as invalid, and everything else as valid.
Duplicate check is separate from validity, no cap. 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. π
-transform cmdprefixβ this option specifies a callback which is invoked whenever a newly entered element is moved from the entry field to the main list, or the entry field is validated, as part of a check for duplicates, if such are not allowed. The callback is given the text in the entry field and has to return the text which is actually added to, or checked against the list. The use case for this callback is essentially input normalization. The most simple case of such would be, for example, the use ofstring tolowerto case on the data. More complex examples can be thought of, like rewriting of multiple syntaxes of input to a canonical form. The signature of this callback is:{*}cmdprefix textβ wheretextis the string to transform. The widget expects that the callback returns the transformed string.
The default is to not transform the entered strings.
-browse cmdprefixβ if this option is specified the widget will display a "Search" button and invoke the callback provided by the option whenever the user clicks on that button. The signature of the callback is:{*}cmdprefix cookievarβ where the cookie variable provides access to context information the callback may wish to preserve between invocations. The initial value stored in the variable is the empty string. After that it is whatever the callback wishes to store. 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.
π WIDGET GENERAL OPTIONS π
-listvariable varnameβ this option specifies the variable holding the list to be manipulated by the widget. Any changes to the list outside of the widget are automatically imported into the widget. Similarly, all changes made to the list by the widget are automatically exported to this variable. Two-way list gossip, lowkey iconic. π¦-state normal|disabledβ this option specifies the status of the widget,normal(= active), ordisabled. A disabled widget can not be edited. The default isnormal.-height integerβ this option specifies the height of the internal listbox, in lines. The default is20.
And now the skin controls β yes, every single one is here, bestie, we are not skipping a crumb: π
-skin-add stringβ skin string.-skin-remove stringβ skin string.-skin-up stringβ skin string.-skin-down stringβ skin string.-skin-browse stringβ skin string.-skin-tip-add stringβ skin tooltip string.-skin-tip-remove stringβ skin tooltip string.-skin-tip-up stringβ skin tooltip string.-skin-tip-down stringβ skin tooltip string.-skin-tip-browse stringβ skin tooltip string.-skin-tip-main stringβ skin tooltip string.-skin-tip-entry stringβ skin tooltip string.-skin-tip-list stringβ skin tooltip string.-skin-tip-empty stringβ skin tooltip string.-skin-tip-duplicate stringβ skin tooltip string.-skin-tip-add-none stringβ skin tooltip string.-skin-tip-remove-none stringβ skin tooltip string.-skin-img-add imageβ skin image.-skin-img-remove imageβ skin image.-skin-img-up stringβ skin image value, typed as string in the manual.-skin-img-down stringβ skin image value, typed as string in the manual.-skin-img-browse stringβ skin image value, typed as string in the manual.-skin-invalid-color colorβ invalid-entry highlight color; defaults toyellow.
These options all modify the appearance of the widget, i.e. its skin. All options taking a string argument influence the various labels shown, with the -skin-tip-* options influencing the tooltips shown on hovering 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.
π EXAMPLE π
The original page has an EXAMPLE heading and then literally nothing under it. No example. Not a crumb. Iconic minimalist behavior, honestly. π
π BUGS, IDEAS, FEEDBACK π
okay so real talk: 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. Weβre keeping it cute but the bug reports are real, bestie. π«Ά
β KEYWORDS β
- data entry lists
- data entry ordered list
- data entry set of strings
- data entry unordered list
- list entry panel
- set entry panel
- widget
Signed off from the tklib source, version 0.1.2, with the footer tag widget_listentry(n) β and the original footer doesnβt show a separate date, so Iβm not inventing one, bestie πβ¨
π¦ where this page comes from
- alpine 3.24: tk-lib-doc 0.7-r0 Β· TCL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms