Files
textual/tests/snapshot_tests/snapshot_apps/textlog_max_lines.py
darrenburns bbd811d671 Support multiple CSS files (#1079)
* Support multiple CSS paths

* Update a type to match docstring

* Ensure the demo app still works

* Use absolute paths in tests to (hopefully) appease Windows

* Notes about CSS changes in guide/docstrings, small grammar/typos fixes

* Move snapshot apps into snapshot_tests dir, improve messaging in snapshot output, add test for multiple css files interacting with classvar CSS

* Ensure consistent snapshot naming cross-platform

* Use rpartition instead of partition in import_app

* Fix handling of import_app when colon in arg

* Support paths containing Windows drive names in import_app

* Add note on new relative paths in snap_compare

* Update docs/guide/CSS.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Fix formatting

* Update CHANGELOG to mention CSS_PATH supporting a list

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2022-11-01 17:13:25 +00:00

21 lines
380 B
Python

from textual.app import App
from textual.widgets import TextLog
class TextLogLines(App):
count = 0
def compose(self):
yield TextLog(max_lines=3)
async def on_key(self):
self.count += 1
log_widget = self.query_one(TextLog)
log_widget.write(f"Key press #{self.count}")
app = TextLogLines()
if __name__ == "__main__":
app.run()