mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* handle docked layers * handle scroll better * snapshot update * remove commented out code * superflous * dock gutter * snapshit * snapshit test * changelog * mistake * docstrings * changelog * whitespace * missing punctuation * ofx docstring * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
20 lines
463 B
Python
20 lines
463 B
Python
from textual.app import App, ComposeResult
|
|
from textual.widgets import Checkbox, Footer
|
|
|
|
|
|
class ScrollOffByOne(App):
|
|
"""Scroll to item 50."""
|
|
|
|
def compose(self) -> ComposeResult:
|
|
for number in range(1, 100):
|
|
yield Checkbox(str(number), id=f"number-{number}")
|
|
yield Footer()
|
|
|
|
def on_ready(self) -> None:
|
|
self.query_one("#number-50").scroll_visible()
|
|
|
|
|
|
app = ScrollOffByOne()
|
|
if __name__ == "__main__":
|
|
app.run()
|