Dynamically Update RadioList
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing RadioList's handling of values, current_values, current_value, and app.invalidate(), then reproduce the update_data example from the issue. Done means replacing the RadioList items at runtime refreshes the displayed options and leaves the selected value consistent.
Written by the indexing model from the issue text.
Description
I was wondering if its possible to dynamically update the items in a RadioList.
I've figured out how to update the data inside of a TextArea, and would like to do something similar with the RadioList:
def handle_enter():
new_value = self.radios.values[self.radios._selected_index][0]
self.radios.current_value = new_value
self.text_area.text = "new text"
self.radios._handle_enter = handle_enter
I've tried updating the RadioList's values and current_values but that didn't work:
def update_data(self, new_threads):
radio_values = [(thread["id"], thread["messages"][0]["subject"]) for thread in threads]
self.radios.values = radio_values
self.radios.current_values = radio_values
self.radios.current_value = radio_values[0][0]
self.text_area.text = "new text"
self.app.invalidate()
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prompt-toolkit/python-prompt-toolkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
prompt-toolkit/python-prompt-toolkit#2073 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
prompt-toolkit/python-prompt-toolkit#1154 · 1 comment ·
All issues in prompt-toolkit/python-prompt-toolkit
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·