When I first encountered Microsoft's Visual Basic back in the early 90s, it was a little gem of a program, small enough to come to grips with quickly, but powerful enough to do anything that a non-professional programmer could want. Unfortunately the intervening years have not been kind to VB, and like many other products from the same stable it has become a resource-hungry behemoth that requires weeks of training to use effectively. But some of the charm and convenience of those early versions has been recaptured for the Linux environment with the Gambas program for Linux.
"Gambas" means "shrimp" in Spanish, and the logo of the program is a funky three-dimensional shrimp. It is designed to run under KDE, but I was able to get it running under GNOME after a clean install; subsequent attempts were less successful. On starting the program the user is prompted to open or create a new "project" -- a self-contained program stored in a separate folder. Although Gambas can be used to develop command-line programs, its main role is in graphical interfaces, and it has a range of options for different graphic interfaces, including QT and GTK+. If you are unsure which to use, or you want to make a general-purpose program, the generic "graphic interface" option should be fine for most systems. Specify a folder location and give your program a name, and you are ready to start designing.
Gambas program design works in terms of controls and containers. The outermost container is a form, and although programs can use several forms and even forms-within-forms, beginners will probably want to start with just one. This is created automatically and given the name FMain. The Gambas window showing the form also displays the form Properties on the right and a hierarchy of Modules, Classes, and Data on the left. Form properties include the name, border shape, background colour and whether the form is resizable.
Opening the Toolbox via the View menu brings up four tabbed panels with types of tools -- Form, Dialog, Container and Special. The Form controls include labels, text fields, buttons, check boxes, radio buttons, scroll bars, drop-down menus, etc -- all the standard elements of windows-style programs -- plus special-purpose panels for displaying directory lists, pictures, and movies. Any of these tools can be dragged out into a rectangle on the form to create an element of that type. The Dialog controls include standard dialog boxes for setting colours, dates, fonts, files and directories. The Container tools include standard vertical or horizontal layouts, and allow controls to be stored in frames or tabbed panels. They also include drawing areas for graphics and stepwise Wizard panels. Finally, the Special tools include a Timer, an Embedding tool for external controls, and a TrayIcon tool. Developers can add a menu through the Menu Editor, described in Part Two of this series.