The syntax of a type specification is given below:
NAME ::= (NAME [KEYWORD ARGUMENT]... ARGS) | NAME
where name is a widget name, keyword is the name of a property, argument is the value of the property, and args are interpreted in a widget specific way.
There following keyword arguments that apply to all widgets:
The initial value for widgets of this type.
This string will be inserted in the buffer when you create a widget. The following ‘%’ escapes are available:
The text inside will be marked as a button.
By default, the text will be shown in
surrounded by brackets.
String to prefix buttons.
String to suffix buttons.
The text inside will be displayed in the face specified by
This will be replaced with the buffer representation of the widget’s value. What this is depends on the widget type.
Insert the string specified by
Like ‘%d’, with the following modifications: If the documentation
string is more than one line, it will add a button which will toggle
between showing only the first line, and showing the full text.
Furthermore, if there is no
:doc property in the widget, it will
instead examine the
:documentation-property property. If it is a
lambda expression, it will be called with the widget’s value as an
argument, and the result will be used as the documentation text.
Insert the string specified by
:tag here, or the
representation of the value if there is no tag.
Insert a literal ‘%’.
Face used to highlight text inside %[ %] in the format.
Text around %[ %] in the format.
These can be
No text is inserted.
The string is inserted literally.
The value of the symbol is expanded according to this table.
The string inserted by the ‘%d’ or ‘%h’ escape in the format string.
The string inserted by the ‘%t’ escape in the format string.
Name of image to use instead of the string specified by ‘:tag’ on Emacsen that supports it.
Message displayed whenever you move to the widget with either
An integer indicating the absolute number of spaces to indent children of this widget.
An integer indicating how many extra spaces to add to the widget’s grandchildren compared to this widget.
An integer indicating how many extra spaces to add to the widget’s children compared to this widget.
A function called each time the widget or a nested widget is changed.
The function is called with two or three arguments. The first argument
is the widget itself, the second argument is the widget that was
changed, and the third argument is the event leading to the change, if
any. In editable fields, this includes all insertions, deletions,
etc. To watch only for “final” actions, redefine the
Tag used in the menu when the widget is used as an option in a
Function used for finding the tag when the widget is used as an option
menu-choice widget. By default, the tag used will be either the
:tag property if present, or the
representation of the
:value property if not.
Should be a function called with two arguments, the widget and a value, and returning non-nil if the widget can represent the specified value.
A function which takes a widget as an argument, and returns nil if the
widget’s current value is valid for the widget. Otherwise it should
return the widget containing the invalid data, and set that widget’s
:error property to a string explaining the error.
The following predefined function can be used:
:children of widget must be valid.
Specify the order in which widgets are traversed with
widget-backward. This is only partially
nil, whichever comes first.
The parent of a nested widget (e.g. a
menu-choice item or an
element of an
This keyword is only used for members of a
checklist. The value should be a list of extra keyword
arguments, which will be used when creating the
checkbox associated with this item.
Directory where glyphs are found. Widget will look here for a file with the same name as specified for the image, with either a ‘.xpm’ (if supported) or ‘.xbm’ extension.
If non-nil, allow glyphs to appear on displays where they are supported.