12345678910111213141516171819202122 |
- # --- Test 32. Use Switch node. --- #
- import nodesnim
- Window("hello world")
- var
- main = Scene("Main")
- switch = Switch()
- main.addChild(switch)
- switch.move(128, 64)
- switch.on_switch =
- proc(self: SwitchRef, toggled: bool) = # this called when the user toggles switch.
- echo toggled
- addScene(main)
- setMainScene("Main")
- windowLaunch()
|