uhelp wrote:
Code:
echo 'help file content. Will appear on screen if F1 is pressed' > some-helpfile
dialog --help-button --hline 'press <F1> to read help' --hfile some-helpfile --menu 'Choose something' 20 40 15 'tag entry one' 'item1' 'second tag entry' 'item2' 2> result_file
rc=$?
echo
echo rc is $rc
printf 'result_file content: '
cat result_file
echo
rm result_file
rm some-helpfile
Note: There are two complete helps. One shows just a text file.
The second just prefixes the output (i.e. the choosen tag) with the uppercase word 'HELP' and sets the exit status to 2.
React either to the output, or on retrun code 'rc'
Not all widgets provided by
dialog know about the help button.
Thank you very much!
But I still not understand why must the user press <F1> to read help text, because there is already the < Help > button?
The <F1> button can be used without the <Help> button by skipping the --help-button, like this:
Code:
#!/bin/bash
echo 'help file content. Will appear on screen if F1 is pressed' > some-helpfile
dialog --hline 'press <F1> to read help' --hfile some-helpfile --menu \
'Choose something' 20 40 15 'tag entry one' 'item1' 'second tag entry' 'item2' 2> result_file
rc=$?
echo
echo rc is $rc
printf 'result_file content: '
cat result_file
echo
rm result_file
rm some-helpfile
My question was: how to use that < Help > button for this purpose, namely, to can read the help text?
For me the < Help > button is there for that purpose, right?
If not, then what for is there the <Help> button?