Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- These are all that's really needed to reproduce the Error.
- Widgets get added via the add_to_screen which then should trigger scolling.
- """
- from textual.app import App
- from textual.containers import ScrollableContainer, Vertical
- from textual.widgets import Static
- class SimpleApp(App):
- MAIN = "main"
- CONTENT_WRAPPER = "wrapper"
- INSTRUCTIONS = "Press \[Enter] to add lines, 'c' to clear"
- def compose(self):
- yield ScrollableContainer(
- Vertical(id=self.MAIN),
- id=self.CONTENT_WRAPPER
- )
- async def add_to_screen(self, widget):
- # This is how widgets are added
- main = self.get_widget_by_id(self.MAIN)
- await main.mount(widget)
- await self.scroll_to_end()
- async def scroll_to_end(self):
- # This is the method used to scroll to the end
- container = self.get_widget_by_id(self.CONTENT_WRAPPER)
- container.scroll_end()
Advertisement
Add Comment
Please, Sign In to add comment