diff options
Diffstat (limited to 'examples/example_91_unhandled_exception.nim')
| -rwxr-xr-x | examples/example_91_unhandled_exception.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/example_91_unhandled_exception.nim b/examples/example_91_unhandled_exception.nim new file mode 100755 index 0000000..d9f46c0 --- /dev/null +++ b/examples/example_91_unhandled_exception.nim @@ -0,0 +1,18 @@ +# This example shows what happens when an unhandled exception occurs in the main loop.
+
+import nigui
+
+app.init()
+
+var window = newWindow()
+
+var container = newLayoutContainer()
+window.add(container)
+
+var button = newButton("Raise Exception")
+container.add(button)
+button.onClick = proc(event: ClickEvent) =
+ raise newException(Exception, "Test Exception")
+
+window.show()
+app.run()
|
