Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL.TerminalMenus: Allow keybindings in RadioMenu #41576

Merged

Conversation

IanButterworth
Copy link
Member

Adds optional keybindings to REPL.TerminalMenus.RadioMenu
I decided not to automatically prepend the keybinding, to allow the user flexibility in formatting.

options = ["o: orange", "a: apple", "b: banana"]
keybindings = ['o', 'a', 'b']
menu = RadioMenu(options, pagesize=3, keybindings = keybindings)
choice = request("Choose your favorite fruit:", menu)
Choose your favorite fruit:
 > o: orange
   a: apple
   b: banana
2 # after pressing 'a'

@IanButterworth IanButterworth added the REPL Julia's REPL (Read Eval Print Loop) label Jul 14, 2021
@IanButterworth IanButterworth merged commit 02c1cf3 into JuliaLang:master Jul 15, 2021
@IanButterworth IanButterworth deleted the ib/radiomenu_keybindings branch July 15, 2021 20:50
jonas-schulze added a commit to jonas-schulze/julia that referenced this pull request Aug 9, 2021
jonas-schulze added a commit to jonas-schulze/julia that referenced this pull request Aug 9, 2021
jonas-schulze added a commit to jonas-schulze/julia that referenced this pull request Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant