diff options
| author | trustable-code <krauter.simon@arcor.de> | 2018-09-27 19:51:27 +0200 |
|---|---|---|
| committer | trustable-code <krauter.simon@arcor.de> | 2018-09-27 19:51:27 +0200 |
| commit | b2dfa6130d71c5196a877e66d122bae2fe4bf3d0 (patch) | |
| tree | 13e059b7135abce107405d501a4eeb8840b3b533 /examples/example_02_controls.nim | |
| parent | 73456d3317516649acd7b9288762219893cb615a (diff) | |
| download | NiGui-b2dfa6130d71c5196a877e66d122bae2fe4bf3d0.tar.gz NiGui-b2dfa6130d71c5196a877e66d122bae2fe4bf3d0.zip | |
example_02: add click event
Diffstat (limited to 'examples/example_02_controls.nim')
| -rwxr-xr-x | examples/example_02_controls.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/example_02_controls.nim b/examples/example_02_controls.nim index 4980ca1..bb544f1 100755 --- a/examples/example_02_controls.nim +++ b/examples/example_02_controls.nim @@ -26,9 +26,13 @@ var textArea = newTextArea("TextArea\nLine 2\n") container.add(textArea)
# Add more text to the TextArea:
-for i in 3..30:
+for i in 3..15:
textArea.addLine("Line " & $i)
+# Add click event to the button:
+button.onClick = proc(event: ClickEvent) =
+ textArea.addLine("Button clicked")
+
window.show()
app.run()
|
