Above, the text of the button was set with a configuration
option. Configuration options determine various attributes of a
widget. They can be given at the time of creation, or changed later
on. In general, the configuration type is just a type
synonym
As seen above, configurations can be given at the time of creation, or
later on. In the latter case, the helpful (#) operator
provides useful syntactic sugar:
Some configurations are only supported by one particular widget, and
thus are a simple monomorphic function. However, most configurations
are supported by many, but not all widgets, and each configuration by
different ones, and this behaviour is modelled in HTKby type
classes. Common configuration classes can be found in the module
Configuration.htmlConfiguration. For example, the
text configuration is given by this class:
The class GUIObject w is one of HTK's most basic classes.
Its instances are widgets and other interface elements we will
encounter later (canvas items, text tags, windows). GUIValue
v is another basic class, the instances of which are all basic
datatypes which can be communicated to Tk: Int,
Double, Bool, String and [String].
Now, all widgets can be configured with a text are instances of the
class HasText, such as Button.