From dd67a61831a69059b6bf1e249a2153712e0a613d Mon Sep 17 00:00:00 2001 From: pgen Date: Thu, 14 Mar 2019 22:52:10 +0100 Subject: Improve the simple_menu example The .eraseafter and .centered directives are now set to yes by default. The message (title) is enhanced. --- examples/simple_menu/main.mnu | 2 -- examples/simple_menu/simple_menu.sh | 11 ++++++----- examples/simple_menu/sub1.mnu | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/simple_menu/main.mnu b/examples/simple_menu/main.mnu index fe3e363..92c517c 100644 --- a/examples/simple_menu/main.mnu +++ b/examples/simple_menu/main.mnu @@ -5,8 +5,6 @@ # .title: The menu tittle .columns 2 -.centered yes -.eraseafter yes .title Simple menu ITEM1 First item 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'/@@@/ /' \ diff --git a/examples/simple_menu/sub1.mnu b/examples/simple_menu/sub1.mnu index 5015142..d654a9e 100644 --- a/examples/simple_menu/sub1.mnu +++ b/examples/simple_menu/sub1.mnu @@ -1,6 +1,5 @@ .columns 1 .title First submenu -.eraseafter yes SUB1ITEM1 First item of the first submenu SUB1ITEM2 Second item of the first submenu === -- cgit v1.2.3