-
Notifications
You must be signed in to change notification settings - Fork 1
/
basic.py
25 lines (19 loc) · 894 Bytes
/
basic.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
from voodoo.gui import Gui
import voodoo.gui.builder as vo
def process_data(state):
print(f"Process Data State: {state['input1']} , {state['input2']}")
def another_function(state):
print(f"Another : Process Data State: {state['input1']} , {state['input2']}")
# Bu blok GUI'yi yalnızca dosya doğrudan çalıştırıldığında başlatacak
if __name__ == "__main__":
with vo.Page() as page:
# Panel başlatıyoruz
with vo.Panel() as panel:
panel.text("Let's Make Some Voodoo!", mode="big") \
.input(id="input1", text="Değer 1") \
.input(id="input2", text="Değer 2") \
.button("Submit", "process_data") \
.button("Another Button", "another_function")
page.add_panel(panel)
page.Setup(title="Getting started with voodoo GUI")
Gui(page).run(debug=True)