summaryrefslogtreecommitdiff
path: root/examples/example_02_controls.nim
diff options
context:
space:
mode:
authortrustable-code <krauter.simon@arcor.de>2017-07-01 14:24:18 +0200
committertrustable-code <krauter.simon@arcor.de>2017-07-01 14:24:18 +0200
commit59aa41ad707a814ea7145248c52f6f16b1c895d3 (patch)
treed70c2142f2c9063e938af31b13e8a0eb79a5dc60 /examples/example_02_controls.nim
downloadNiGui-59aa41ad707a814ea7145248c52f6f16b1c895d3.tar.gz
NiGui-59aa41ad707a814ea7145248c52f6f16b1c895d3.zip
first public preview version
Diffstat (limited to 'examples/example_02_controls.nim')
-rwxr-xr-xexamples/example_02_controls.nim34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/example_02_controls.nim b/examples/example_02_controls.nim
new file mode 100755
index 0000000..4980ca1
--- /dev/null
+++ b/examples/example_02_controls.nim
@@ -0,0 +1,34 @@
+# This example shows several controls of NiGui.
+
+import nigui
+
+app.init()
+
+var window = newWindow()
+
+var container = newLayoutContainer(Layout_Vertical)
+window.add(container)
+
+# Add a Button control:
+var button = newButton("Button")
+container.add(button)
+
+# Add a Label control:
+var label = newLabel("Label")
+container.add(label)
+
+# Add a TextBox control:
+var textBox = newTextBox("TextBox")
+container.add(textBox)
+
+# Add a TextArea control:
+var textArea = newTextArea("TextArea\nLine 2\n")
+container.add(textArea)
+
+# Add more text to the TextArea:
+for i in 3..30:
+ textArea.addLine("Line " & $i)
+
+window.show()
+
+app.run()