If you decide to write some programs for Haiku or to compile existing code on Haiku, the reference native application for that is Genio today.
In this article, we will review the main features of this tool and how to compile a simple program.
As Genio is a featured native application, you can install it via the "Featured packages" tab in HaikuDepot when searching for "genio" :
Proceed with the installation.
Once it's done, open Genio and the below main window will be displayed :
Let's create a basic C++ Haiku program. In the File menu select "New>BApp with window, menu" :
Indicate the location of your project and its name :
Once completed, the below files will be created : easy, isn't it ?
The Makefile will be used to build the program.
If you open "App.cpp" in Genio, you will see the main program is using the Haiku API :
You can also check the "MainWindow.cpp" file : it contains the menu construction and interaction.
Now, let's build the program. Click on the build project icon :
You should see the below logs in the "Build log" tab :
Once done, click on the run icon :
As you can see, we need to indicate which program to run : click on the Configure button.
Then indicate in the "Target" field : MyApp
Now run again the program.
You should see the below window with a simple file menu :
Let's click on "About" :
Yes, the wonderful "MyApp" is ready for your improvements :)
Genio is really a useful tool to browse your project source code but it has also additional nice features.
You can for instance Fold/Unfold the source code to focus only on part of it : Below the minus icon indicates than part of the source code can be fold :
Once fold, it can be unfold with the plus icon. :
Another nice feature is the ability to go into the definition of a class.
Do you want to understand how a BApplication is defined ?
Click on its name in the source code and then Opt+G (or use popup menu "Go to definition") :
The Application.h header file is opened and the Application class is displayed :
Really cool ?
Another nice feature is the ability to rename a variable or a class in your project. Suppose you would like to rename your "MainWindow" class.
For that right-click on the name and select "Rename symbol" :
Then indicate the new name like "GreatWindow" :
As you can see App.cpp, MainWindow.cpp and MainWindow.h have been updated with the new name :
Another feature is the possibility to create a "catkeys" which is useful to translate your application to other langages.
For that click on the "Project" menu and then select "Make catkeys" :
A new "en.catkeys" has been created with the below content corresponding to the application :
With Genio, you can also debug your program with the default Haiku Debugger or use Templates to start coding with some standard source samples.
If you would like to know more about Genio, don't hesitate to use the "Help" menu in the application :
A nice documentation has been written :
Want to share your experience with Genio ?
In that case, put a comment below :)