diff options
author | pgen <p.gen.progs@gmail.com> | 2019-03-14 22:52:10 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2019-03-17 20:54:28 +0100 |
commit | dd67a61831a69059b6bf1e249a2153712e0a613d (patch) | |
tree | a0c3f9690be6970edc4e2ee233d20af960d9e958 /examples/simple_menu/simple_menu.sh | |
parent | a6c52c745432db01b8b4f66f4bdf6d0dc320f9f7 (diff) |
Improve the simple_menu example
The .eraseafter and .centered directives are now set to yes by default.
The message (title) is enhanced.
Diffstat (limited to 'examples/simple_menu/simple_menu.sh')
-rwxr-xr-x | examples/simple_menu/simple_menu.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/simple_menu/simple_menu.sh b/examples/simple_menu/simple_menu.sh index 2092478..e5b0280 100755 --- a/examples/simple_menu/simple_menu.sh +++ b/examples/simple_menu/simple_menu.sh @@ -47,9 +47,9 @@ USER_PROGRAM=$2 # ======================================================================= # function process_menu { - TITLE="[ENTER: select, q: abort]"$'\n' # Untitled by default - CENTERING= # Is the menu centered in the screen ? - ERASE= # Destroy the selection window after use + TITLE=$'\n'"[ENTER: select, q: abort]" # Untitled by default + CENTERING="-M" # Is the menu centered in the screen ?, defaults to yes + ERASE="-d" # Destroy the selection window after use. Defaults to yes MENU_FILE=$1 MENU= # Make sure the working area is empty @@ -72,11 +72,11 @@ function process_menu ;; .centered) # Is the menu centered? - [[ $VALUE == yes ]] && CENTERING="-M" + [[ $VALUE == no ]] && CENTERING="" ;; .eraseafter) # Will the space used by the menu be reclaimed? - [[ $VALUE == yes ]] && ERASE="-d" + [[ $VALUE == no ]] && ERASE="" ;; .title) # The menu title @@ -145,6 +145,7 @@ function process_menu -N \ -F -D o:10 i:0 n:2 \ -n \ + -a m:0/6 \ -m "$TITLE" \ -t $COL \ -S'/@@@/ /' \ |