Gambas 3 Tutorial – Create a new project

October 4, 2016 | By | Reply More

On this tutorial, I will show you how to get started with Gambas 3. Gambas is an IDE for Linux which can be used to build your own program/software with Basic like language. Its pretty easy to learn especially if you are familiar with Visual Basic in Windows. I am using Elementary OS Loki on this tutorial.

First, install Gambas3 on your distribution. For Ubuntu based Linux, you can execute this command to install Gambas 3.

sudo apt-get install gambas3

Now open Gambas from application menu. The Gambas 3 IDE will open and click New Project to start a new project.

gambas 3 tutorial - new project 1.png

There are several Project Type supported by Gambas 3. Here I want to build a simple Graphical application. So click Graphical Application and press Next. You will need to specify where the project will be saved. Select the destination directory.

gambas 3 tutorial - new project 2.png

For example, I created a new folder called Gambas to store my Gambas project.

gambas 3 tutorial - new project 3.png

Type the Project name and Project Title. Its pretty self explained. When you press OK, we can start building our first application.

gambas 3 tutorial - new project 4.png

Now we will try to create our first program with Gambas. Double click FMain on the left panel. And add a new button control to the FMain.

gambas 3 tutorial - new project 5.png

You can modify the properties of the button from the Properties panel on the right.

Now we need to add code to the button. For example when click event occur, the code will be executed. Right click on the button and go to Events and select Click.

gambas 3 tutorial - new project 6.png

It will bring up the code window.

gambas 3 tutorial - new project 7.png

Type the following code

Public Sub Button1_Click()
Message(“Hello World”)
End

Now run the program.

 gambas-tutorial-1

Tags: , ,

Category: Gambas, Programming

Leave a Reply