From cd09fe622f950e5d2010bca0f2df27067af8c76d Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Sat, 7 Sep 2024 12:54:36 +0200 Subject: [PATCH] add menu.jl --- examples/menu.jl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/menu.jl diff --git a/examples/menu.jl b/examples/menu.jl new file mode 100644 index 00000000..6c96d05b --- /dev/null +++ b/examples/menu.jl @@ -0,0 +1,22 @@ +using REPL.TerminalMenus + +options = ["autopilot_1p = include(\"autopilot_1p.jl\")", + "autopilot = include(\"autopilot.jl\")", + "quit"] + +function menu() + active = true + while active + menu = RadioMenu(options, pagesize=8) + choice = request("\nChoose function to execute or `q` to quit: ", menu) + + if choice != -1 && choice != length(options) + eval(Meta.parse(options[choice])) + else + println("Left menu. Press to quit Julia!") + active = false + end + end +end + +menu() \ No newline at end of file