Skip to content

Commit

Permalink
add menu.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Sep 7, 2024
1 parent f81f7d4 commit cd09fe6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/menu.jl
Original file line number Diff line number Diff line change
@@ -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 <ctrl><d> to quit Julia!")
active = false
end
end
end

menu()

0 comments on commit cd09fe6

Please sign in to comment.