Creating and using a style is very similar to creating and using a tag in the Text widget, except you get a bit more reusability with Tix item styles. If you predefine what you’d like the style to look like, you can use it throughout your program many times with different Tix widgets. If you need to change how those items are displayed, you can change the definition of the style instead of changing each individual item.
To create a
new style, call the
$styleref = $parentwidget->ItemStyle('text', -stylename => 'stylename', [ option => value, ... ] );
The first parameter to
ItemStyle must be an item
$parentwidget you use is important only because it
determines the default values of all the style options. If you use a
TList as the parent widget, with a default font of
14", then the style will use that font unless the
-font option is explicitly changed. You can use
any widget as the parent widget, including the MainWindow
The rest of the arguments to
option/value pairs. You can use any of the following option/value
Gives the style a name. Note that you don’t really need this, because you use the reference to the style when creating items, not the name of the style. However, it’s useful if you intend to let users create and manipulate styles, since it might help them remember which style is which.