
This is one element in the FillOut listbox. In the example with the prompt, this might eg. be the ``current working directory''
\[$name\], where $name refers to the name of
the FillOutElm)
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: