pikapython/test/python/PikaUI/PikaUI_backend_text.py

37 lines
777 B
Python
Raw Normal View History

2023-02-22 20:39:59 +08:00
class widget:
name = "widget"
def __init__(self, parent):
if parent == None:
name = 'None'
else:
name = parent.name
print('%s.__init__(%s)' % (self.name, name))
def align(self, align, posx, posy):
print('%s.align(%d, %d, %d)' % (self.name, align, posx, posy))
def set_width(self, width):
print('%s.set_wdith(%d)' % (self.name, width))
def set_height(self, height):
print('%s.set_height(%d)' % (self.name, height))
def set_text(self, text):
2023-02-22 21:59:28 +08:00
print('%s.set_text("%s")' % (self.name, text))
class Screen:
name = "screen"
_screen = Screen(None)
2023-02-22 20:39:59 +08:00
class label(widget):
name = "label"
2023-02-22 20:39:59 +08:00
def screen():
return _screen
2023-02-22 22:05:08 +08:00
def clean():
print('screen.clean()')