From a8c40d196ce7e18837960cbdf0f2fd95ffb9d0e2 Mon Sep 17 00:00:00 2001 From: nixo Date: Sun, 10 Jan 2021 12:08:44 +0100 Subject: [PATCH] remove selected and use new menu syntax --- run.scm | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/run.scm b/run.scm index 9bc1dc1..77cc291 100644 --- a/run.scm +++ b/run.scm @@ -67,32 +67,41 @@ (nixo (format #f "You chose: ~a\n" (menu - '("Select me!" "Or me!" "No, select me!") + '(("Select me!") + ("Or me!") + ("No, select me!")) #:prototype radio-button))) (nixo "Choose as many as you want!") (nixo (format #f "You chose ~a\n" - (menu '(("A") ("B") ("C")) + (menu '(("A" 0) + ("B" 1) + ("C" 2)) + #:prototype checkbox-button + #:seed '() #:pressed cons))) + (nixo "Choose as many as you want!") + (nixo + (format #f "You chose ~a\n" + (menu '(("A" 0 (pressed)) + ("B" 1 (selected)) + ("C" 2 (pressed))) #:prototype checkbox-button #:seed '() #:pressed cons))) (nixo "Click it!") (nixo (format #f "You chose the element number: ~a\n" (menu - '("Yes" "Maybe" "No way") - #:selection 1))) + '("Yes" "Maybe" "No way")))) (nixo "Click it again!") (nixo (format #f "You chose the element: ~a\n" (menu - '(("Yes") ("Maybe") ("No way")) - #:selection 0))) + '(("Yes") ("Maybe") ("No way"))))) (nixo "Once more!") (nixo (format #f "You chose the element: ~a\n" (menu - '(("Yes" . yep) ("Maybe" . maybe) ("No way" . nope)) - #:selection 2))) + '(("Yes" . yep) ("Maybe" . maybe) ("No way" . nope))))) *unspecified*)) scene) (init-menu! #s32(100 100) #s32(0 50) simple-button #:scene scene)