next up previous contents
Next: Default values Up: Element on a configuration page Previous: Element on a configuration page

Syntax and Variables

All the elements on the configuration page have the same syntax, which is as follows:
element_name [-option value [value ..]] .. All the values for a single option will then be concatenated, which makes it easier to write beautiful code like this:

CheckBox save -text save on exit -default 1 -help "This options" \
     "let you tell ..." (etc etc)

Insert an extra dash, if a value starts with a dash, (No Tk option starts with two dashes, so this is safe.) The extra dash you insert will be removed before the value is used.

Ex: -font -*-helvetica-medium-r-*-*-18-* will be specified
as: -font -*-helvetica-medium-r-*-*-18-*
NOTE: It is not recommended to refrain from using quotation marks in the Desc field and to the help option, because every word will then be checked to see if it is an option, in contrast to the quotation mark situation where everything between the quotation marks is considered as one word.

The Link to Variable section tells how the information is available in the Save, Change, Init and PageEnd procedure.

All the places where the default value for the option (the value which it is set to, if it isn't specified) is nonempty, it is specified like this: default: value

NOTE: the -defaultIndex switch is just a shortcut for the Menu, ListBox, Radio and ComboBox widget. If these widget are located inside eg. an ExtEntry, and a default value have to be given, the -default still have to give the text as default value.



Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996