pikapython/test/python/PikaUI/test_page.py

21 lines
376 B
Python
Raw Normal View History

import PikaUI as ui
from PikaStdLib import MemChecker as mem
2023-02-23 00:36:08 +08:00
class Page1(ui.Page):
def build(self):
return ui.Text('Hello Page1')
2023-02-22 21:59:28 +08:00
class Page2(ui.Page):
def build(self):
return ui.Text('Hello Page2')
2023-02-22 21:59:28 +08:00
app = ui.App()
2023-02-23 00:36:08 +08:00
app.pageManager.enter(Page1())
2023-02-24 00:57:46 +08:00
app.timer.cb(0)
2023-02-22 22:05:08 +08:00
app.pageManager.enter(Page2())
2023-02-24 00:57:46 +08:00
app.timer.cb(0)
2023-02-22 22:05:08 +08:00
app.pageManager.back()
2023-02-24 00:57:46 +08:00
app.timer.cb(0)