X-Git-Url: http://nitlanguage.org diff --git a/lib/app.nit b/lib/app.nit index b896dad..7ee9493 100644 --- a/lib/app.nit +++ b/lib/app.nit @@ -25,7 +25,11 @@ module app # This class is redefed by plateform modules and so # App can be specialized directly in the user app. class App - private init do end + protected init do end + + # Starts the internal setup of graphical and other stuff + # Is called just before run + fun setup do end # Main entry point of your application fun run do end @@ -38,7 +42,16 @@ class App # Helper function for logging warnings fun log_warning(msg: String) do sys.stderr.write "{log_prefix} warn: {msg}\n" + + # Main init method for graphical stuff + # Is called when display is ready so graphical assets + # can be loaded at this time. + fun window_created do end + + # Called before destroying the window + fun window_closing do end end protected fun app: App do return once new App +app.setup app.run