mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Digits (#3073)
* Digits * digits widget * update requires str * digits docs * simplify * tweak docs * snapshot test * change name * simplify * docs * Update _digits.py superfluous import * Update _digits.py docstring * address review * formatting * Update tests/snapshot_tests/snapshot_apps/digits.py Co-authored-by: Dave Pearson <davep@davep.org> --------- Co-authored-by: Dave Pearson <davep@davep.org>
This commit is contained in:
22
docs/examples/widgets/digits.py
Normal file
22
docs/examples/widgets/digits.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Digits
|
||||
|
||||
|
||||
class DigitApp(App):
|
||||
CSS = """
|
||||
Screen {
|
||||
align: center middle;
|
||||
}
|
||||
#pi {
|
||||
border: double green;
|
||||
width: auto;
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Digits("3.141,592,653,5897", id="pi")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = DigitApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user