Table of contents > Appendix: All widget configurations

Appendix: All widget configurations

In this appendix we present the specific full syntax used to define each widget as well as the extra options/configuration available.

String entry widget

Basic configuration

Key (string) Value
widget_name 'string_entry'
type str

Keyword arguments ('widget_kwargs'):

Key (string) Value
validation_command None (default value) for no validation; a callable that returns True when the string on the entry is valid and False when it is not; a string indicating the name of any str method to be used for validation, like 'isupper', 'islower', etc.; 'literal_eval' or 'json' can also be used, and make it so the widget only allows text representing a python literal or json, respectively.
formatting_command None (default value) for no formatting; a callable that receives the string on the entry and returns a new string to replace it (which may be equal, though); for instance, in an entry where you expect colors values in the '#ffffff' format, you might use this to automatically add a '#' character at the beginning if the string doesn't have it.

Text display widget

Basic configuration

Key (string) Value
widget_name 'text_display'
type str

Keyword arguments ('widget_kwargs'):

Key (string) Value
no_of_visible_lines As the name implies, defines the number of lines that can be visible in the widget; default is 7.
syntax_highlighting An empty string (the default value) for no syntax highlighting; use 'python' for highlighting text representing python code.
show_line_number False (default value) makes it so no line number is shown; True makes it so line numbers are shown.
validation_command None (default value) for no validation; a callable that returns True when the string on the entry is valid and False when it is not; a string indicating the name of any str method to be used for validation, like 'isupper', 'islower', etc.; 'literal_eval' or 'json' can also be used, and make it so the widget only allows text representing a python literal or json, respectively.

Intfloat entry widget

Basic configuration

Key (string) Value
widget_name 'int_float_entry'
type int or float or (int, float) or (int, None) or (float, None) or (int, float, None); the tuples can be in any order and where None is used you can optionally use type(None) as well; the types used are the ones allowed in the entry and there must be at least one numeric type;

Keyword arguments ('widget_kwargs'):

Key (string) Value
min_value used to limit the value in the entry to the provided minimum value (if any); None (default value) means no minimum value; otherwise you must use a number from the numeric type(s) used in the type hint; if max_value is provided, it must also be lower than it (or equal to it);
max_value same as min_value, but limits the value in the entry to the provided maximum value.
normal_drag_increment describes the speed by which dragging the value in the entry with the mouse changes the value within the entry; if you use this option, you must provide a number of the numeric type(s) used in the type hint; the default value, None, sets this value to 10 or 10.0 (depending on the numeric type(s) used).
preciser_drag_increment same as the normal_drag_increment, but must be lower than it; also describes a speed by which the mouse changes the value within the entry when being dragged while the <Shift> key is pressed; as the name implies, it is supposed to be a subtler, preciser change, which is why the value is lower; the default value, None, sets this value to 1 or 1.0 (depending on the numeric type(s) used).
normal_click_increment describes the amount by which the value in the entry is incremented/decremented when clicking the outer, double arrows inside the entry; if you use this option, you must provide a number of the numeric type(s) used in the type hint; the default value, None, sets this value to 10 or 10.0 (depending on the numeric type(s) used).
preciser_click_increment same as the normal_click_increment, but corresponds to increments/decrements triggered when clicking the inner, single arrows inside the entry; the default value, None, sets this value to 1 or 1.0 (depending on the numeric type(s) used).

Check button widget

Basic configuration

Key (string) Value
widget_name 'check_button'
type bool

The check button widget doesn't have extra options ('widget_kwargs').

Color button widget

Basic configuration

Key (string) Value
widget_name 'color_button'
type tuple or str; if tuple, tuples with integers are used to represent colors (for instance: (0, 0, 0) for black); if string, hex strings are used to represent colors (for instance, '#000000' for black).

Keyword arguments ('widget_kwargs'):

Key (string) Value
alone_when_single the color button widget always allows users to define more than one color if they want, in which case the colors are all held within a tuple; this options just affects the behaviour of the widget when only a single color is defined; when True (the default), the color value will be held by itself; when False, though, it will be kept inside a tuple.

Literal entry widget

Basic configuration

Key (string) Value
widget_name 'literal_entry'
type Any python literal type or combination thereof within a tuple; remember: this is just a convenience to indicate the expected type, since you still can use any literal you want in the entry, no matter what you specify here;

The literal entry widget doesn't have extra options ('widget_kwargs').

Literal display widget

Basic configuration

Key (string) Value
widget_name 'literal_display'
type Any python literal type or combination thereof within a tuple; remember: this is just a convenience to indicate the expected type, since you still can use any literal you want in the widget, no matter what you specify here;

Keyword arguments ('widget_kwargs'):

Key (string) Value
no_of_visible_lines As the name implies, defines the number of lines that can be visible in the widget; default is 7.
show_line_number False (default value) makes it so no line number is shown; True makes it so line numbers are shown.

Option menu widget

Basic configuration

Key (string) Value
widget_name 'option_menu'
type Any python literal type or combination thereof within a tuple; remember: this is just a convenience to indicate the expected type, since you still can use any literal you want, no matter what you specify here;

Keyword arguments ('widget_kwargs'):

Key (string) Value
options This option is required; collections of the options available in the dropdown menu;

Option tray widget

It has the same configuration as the option menu, but the widget_name must be option_tray. Also remember that all the options must fit within the node's width.

Sorting button widget

Basic configuration

Key (string) Value
widget_name 'sorting_button'
type either str or int or float or a combination of int and float within a tuple;

Keyword arguments ('widget_kwargs'):

Key (string) Value
available_items This option is required; must be a set of the options available for picking/sorting;

Preview widgets

All preview widgets have a very similar configuration, so here we present them together.

Basic configuration

Key (string) Value
widget_name 'path_preview' or 'text_preview' or 'audio_preview' or 'image_preview' or 'video_preview' or 'font_preview'
type str

Keyword arguments ('widget_kwargs'):

Key (string) Value
string_when_single the preview widgets always allows users to define more than one path if they want, in which case the paths are all held within a tuple; this options just affects the behaviour of the widget when only a single path is defined; when True (the default), the path value will be held by itself, that is, a string; when False, though, it will be kept inside a tuple, that is, a string inside a tuple.

Table of contents