
Next: FillOut
Up: Element on a configuration page
Previous: FillOut / FillOutElm
This is one element in the FillOut listbox. In the example with the
prompt, this might eg. be the ``current working directory''
- -text
- This is the text which is printed in the listbox
- -save
- This is a function which generates the part of the string
this element represents. The result must be generated with the print
function.(default: print $name, where $name refers to the name of
the FillOutElm)
- -show
- This is the string which is shown in the entry. The
result must be generated with the print function. (default:
-print
\
[$name\
], where $name refers to the name of
the FillOutElm)
- -entries
- If the element has any options, then they might be
configured as ordinary elements (CheckBox, Entry etc.). This is a
list of elements which belong to this FillOutElm.
- -help
- This is help for the FillOutElm.
- -change
- This is a change function for the elements which
are specified with -entries.
- -init
- This is an Init function for the elements which
are specified with -entries.
- -pageEnd
- This is a PageEnd function for the elements which
are specified with -entries.
- -showPage
- The argument to this function is called each time,
the fillOutElm element is opened.
- -export
- This tells wether the widget shall be exported or not.
The elements specified with -entries links to variables as
usual in the save function (specified with -save),the
show function (specified with -show), the pageend function
(specified with -pageEnd) and the init function (specified with -init.)
First let's see a simple case:
FillOutElm prompt \
-text "The current working directory"\
-show {print <cwd>} \
-save {print %c} \
-help "This will expand to the current working directory."
This will put an element in the checkbox with the text The
current working directory, when that element is selected, the text
<cwd> will show up in the entry, and finally when the FillOut is
saved, then %c will be inserted in the final string in the
placed where the listbox element was selected.
And now for a case, where there are options to the element:
CheckBox useTilde \
-text "Use tilde substitution"
CheckBox trailing \
-text "Show only the trailing part of the path"
CheckBox showSkipped \
-text "Show number of skipped elements"
Int dirs \
-text "Number of directories to see in the path"
FillOutElm cwd \
-text "current working directory" \
-entries useTilde line1 trailing showSkipped dirs\
-show {print \[cwd\]}\
-save {
if {$trailing} {
print "[pick $useTidte {%c} {%C}][pick $showSkipped {0} {}]$dirs"
} else {
print [pick $useTidte "%~" "%/"]
}
} \
-change {
if {$trailing} {
Enable showSkipped dirs
} else {
Disable showSkipped dirs
}
}
Here there are four options to the current working directory:
- Use of tilde expansion or not
- cut the directory, so only some part of it is shown
- show the number of skipped elements if case 2 is selected.
- number of directories to show in case 2.
The save function takes care of converting the information from the
selection to the right format.
showSkipped and dirs will be disabled if
trailing isn't selected, and that's what the change function takes
care of.
When the FillOut element is selected, the following page will show up:
Here you can configure the four options to the FillOutElm.
Next: FillOut
Up: Element on a configuration page
Previous: FillOut / FillOutElm
Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996