Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add docs for initial_selected arg of checkboxlist_dialog & `radio…
…list_dialog` See #1196 & 584a474
  • Loading branch information
sedrubal committed Oct 29, 2020
commit ba2899a45f2237d93558b0ff7dbc1f323b3c37a4
26 changes: 14 additions & 12 deletions docs/pages/dialogs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ each providing the return value (first element) and the displayed value (second

from prompt_toolkit.shortcuts import radiolist_dialog

result = radiolist_dialog(
title="RadioList dialog",
text="Which breakfast would you like ?",
values=[
("breakfast1", "Eggs and beacon"),
("breakfast2", "French breakfast"),
("breakfast3", "Equestrian breakfast")
]
result = radiolist_dialog(
title="RadioList dialog",
text="Which breakfast would you like ?",
values=[
("breakfast1", "Eggs and beacon"),
("breakfast2", "French breakfast"),
("breakfast3", "Equestrian breakfast")
],
initial_selected='breakfast2'
).run()


Expand All @@ -118,15 +119,16 @@ The :func:`~prompt_toolkit.shortcuts.checkboxlist_dialog` has the same usage and

from prompt_toolkit.shortcuts import checkboxlist_dialog

results_array = checkboxlist_dialog(
title="CheckboxList dialog",
results_array = checkboxlist_dialog(
title="CheckboxList dialog",
text="What would you like in your breakfast ?",
values=[
values=[
("eggs", "Eggs"),
("bacon", "Bacon"),
("croissants", "20 Croissants"),
("daily", "The breakfast of the day")
]
],
initial_selected=['eggs', 'croissants']
).run()


Expand Down