-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
46 lines (39 loc) · 953 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import argparse
from carta import ReMarkable, Widget
def main():
parser = argparse.ArgumentParser(
prog="myapp",
description="Example carta application",
)
parser.add_argument(
"--simple-executable",
help="Path to the simple application",
action="store",
default=None,
dest="simple",
)
args = parser.parse_args()
rm = ReMarkable(simple=args.simple) if args.simple is not None else ReMarkable()
rm.eclear()
button = Widget(
id="back",
typ="button",
value="back",
justify="left",
x="0",
y="0",
)
text = Widget(
id="hello",
typ="label",
value="Hello World!",
x="50%",
y="50%",
)
rm.add(text)
rm.add(button)
while True:
clicked = rm.display()
if clicked and clicked[0] == button.id:
print("Quitting...")
break