Skip to content

Commit 2498e08

Browse files
gregornitheCapypara
authored andcommitted
Library: Port 'Button' to Python
1 parent 7cd41c3 commit 2498e08

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Library/demos/Button/main.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import workbench
2+
3+
button_ids = [
4+
"regular",
5+
"flat",
6+
"suggested",
7+
"destructive",
8+
"custom",
9+
"disabled",
10+
"circular-plus",
11+
"circular-minus",
12+
"pill",
13+
"osd-left",
14+
"osd-right",
15+
]
16+
17+
18+
def on_clicked(button):
19+
print(f"{button.get_name()} clicked")
20+
21+
for id in button_ids:
22+
button = workbench.builder.get_object(id)
23+
button.connect("clicked", on_clicked)

0 commit comments

Comments
 (0)