Spaces:
Running
Running
File size: 791 Bytes
042d8bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, CENTER
class CoreFlowGUI(toga.App):
def startup(self):
label = toga.Label("مرحبًا بك في CoreFlow!", style=Pack(text_align=CENTER, font_size=18))
button = toga.Button("اضغطني", on_press=self.say_hello, style=Pack(padding=10))
box = toga.Box(style=Pack(direction=COLUMN, alignment=CENTER, padding=20))
box.add(label)
box.add(button)
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = box
self.main_window.show()
def say_hello(self, widget):
self.main_window.info_dialog("تحية", "أهلاً بك يا أسامة 👋")
def main():
return CoreFlowGUI()
|