-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
37 lines (27 loc) · 816 Bytes
/
app.py
File metadata and controls
37 lines (27 loc) · 816 Bytes
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
import toga
from toga.style import Pack
from toga.style.pack import COLUMN
class BeeWareBrowser(toga.App):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.main_window = None
def startup(self):
self.main_window = toga.MainWindow(title=self.formal_name, size=(1024, 768))
webview = toga.WebView(
url='https://api2app.org',
style=Pack(flex=1)
)
box = toga.Box(
children=[webview],
style=Pack(direction=COLUMN, flex=1)
)
self.main_window.content = box
self.main_window.show()
def main():
return BeeWareBrowser(
formal_name='api2app',
app_id='org.beeware.browser',
)
if __name__ == '__main__':
app = main()
app.main_loop()