Add small interactive test scripts
This commit is contained in:
parent
32bc9af2d8
commit
1803a6676e
4 changed files with 91 additions and 0 deletions
20
test_scripts/display_attr_text_widget.py
Normal file
20
test_scripts/display_attr_text_widget.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import urwid
|
||||
import urwid.curses_display
|
||||
|
||||
import cheuph
|
||||
from cheuph import AT, AttributedTextWidget
|
||||
|
||||
|
||||
class TestWidget(urwid.WidgetWrap):
|
||||
def __init__(self):
|
||||
text = AT("Hello world!\nThis is some text.\nThird line.")
|
||||
self.text = AttributedTextWidget(text)
|
||||
self.filler = urwid.Filler(self.text)
|
||||
super().__init__(self.filler)
|
||||
|
||||
def main():
|
||||
screen = urwid.curses_display.Screen()
|
||||
loop = urwid.MainLoop(TestWidget(), screen=screen)
|
||||
loop.run()
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue