Stuck on synching widget's data. #5527
Answered
by
TomJGooding
V205Arduino
asked this question in
Q&A
-
Hello,
Sorry for no comments... |
Beta Was this translation helpful? Give feedback.
Answered by
TomJGooding
Feb 15, 2025
Replies: 1 comment 1 reply
-
The from textual.app import App, ComposeResult
from textual.widgets import MarkdownViewer, TextArea
class MarkdownEditor(App):
def compose(self) -> ComposeResult:
yield TextArea.code_editor(language="markdown")
yield MarkdownViewer(show_table_of_contents=True)
def on_text_area_changed(self, event: TextArea.Changed) -> None:
self.query_one(MarkdownViewer).document.update(event.text_area.text)
if __name__ == "__main__":
app = MarkdownEditor()
app.run() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
V205Arduino
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
MarkdownViewer
widget doesn't have a reactivetext
attribute. You'll need to use theupdate
method of the underlyingMarkdown
widget: