Skip to content

Commit c5af9a5

Browse files
gregornitheCapypara
authored andcommitted
Library: Port 'Checkboxes' to Python
1 parent b818b56 commit c5af9a5

File tree

1 file changed

+16
-0
lines changed
  • src/Library/demos/Checkboxes

1 file changed

+16
-0
lines changed

src/Library/demos/Checkboxes/main.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import workbench
2+
3+
checkbox_1 = workbench.builder.get_object("checkbox_1")
4+
checkbox_2 = workbench.builder.get_object("checkbox_2")
5+
6+
checkbox_1.connect("toggled", lambda *_:
7+
print("Notifications Enabled"
8+
if checkbox_1.get_active()
9+
else "Notifications Disabled")
10+
)
11+
12+
checkbox_2.connect("toggled", lambda *_:
13+
print("Changes will be auto-saved"
14+
if checkbox_2.get_active()
15+
else "Changes will not be auto-saved")
16+
)

0 commit comments

Comments
 (0)