Basic App Structure - ZvontyFlugence/NiGui GitHub Wiki
All basic NiGui applications should follow these steps
First, in order to use any of NiGui's features or capabilities, you must first import the NiGui library. You can do this with this line of code:
import nigui
The second step in creating a NiGui application will be to initialize the application. Without this you will still have access to NiGui features, but with a more limited scope. If you are writing your main app window file, you must include this line:
app.init()
In order to start the GUI for your application, you will need to first create a new window to hold all of the components of your application. You can do this by:
var window = newWindow()
You can also optionally include a string parameter in the creation of a new window, this string will become the title of the window. The next step after creating a window will be to add a single component or a container which can hold multiple components, which can be done using the following method:
window.add(control: Control)
Once you've completed your window, you will need it to be visible for you to actually see what you've made. This can be done by calling:
window.show()
So now you've completed your app, but how does it run? In order to run a NiGui application, you must call this function to put everything you've made thus far into action:
app.run()
Congratulations! You've made a functioning NiGui application!