simonkrauter / NiGui

Cross-platform desktop GUI toolkit written in Nim
MIT License
718 stars 50 forks source link

example_91_unhandled_exception.nim needs to specify Layout type. #40

Closed UNIcodeX closed 5 years ago

UNIcodeX commented 5 years ago

Example example_91_unhandled_exception.nim is missing specification of Layout type in newLayoutContainer()

# 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()

Possible solutions:

  1. Change of var container = newLayoutContainer() to var container = newLayoutContainer(Layout_Vertical).

  2. Set a default for newLayoutContainer()

simonkrauter commented 5 years ago

Thanks for reporting :)