Introduction to GNU step

GNU step is a free, standard, object-oriented, cross-platform development environment meant to provide generalized visual interface design, a cohesive user interface, and look good as well. GNU step is based on and completely compatible with the Open Step specification developed by NeXT (now Apple Computer Inc.).

GNU step is not a window manager

GNU step is a whole load of things, but primarily a framework (libraries, tools, applications) for developing software. It is not a window manager. And the libraries are not used by WindowMaker at present, although Window Maker shares a similar look. At no stage will you ever ‘run’ GNU step – you will run applications and tools and will make use of its services. At some point, you may well find packages distributed as ‘GNUstep’ systems in the way that you get ‘GNU/Linux’ systems packaged today. Look at Simply GNUstep, the GNU step Live CD, and Project Backbone for examples.

Additions to Open Step

In addition to the Open Step API, GNU step also implements many additional classes and methods, some from the Cocoa API for the sake of compatibility. GNU step is written in the object-oriented language Objective-C, a superset of C which adds object-orientation to C. Objective-C is very simple, yet very powerful. GNU step also includes bindings to other languages such as Java (JIGS) and Ruby (RIGS). For more information, see the following testimonial from a GNU step user.

Why should I learn Objective-C?

Objective-C gives you the full power of a true object-oriented language with exactly one syntax addition to C and a dozen additional keywords. Its power lies in its elegance and simplicity.

Why should I use GNU step?

GNU step provides an excellent, mature framework for writing good applications. There’s good anecdotal evidence that Open Step developers have written very complex commercial applications in weeks or months, rather than years (or often, never) in the case of other development environments. Using the visual interface modelling application, you can construct a decent user interface skeleton in a day or so with no coding.

Why not just use GNOME/KDE, X11, and C/C++?

GNU step works with GNOME, KDE, as well as many X11-based window managers. GNUstep runs on top of X11. You can still do programming in C (since Objective-C is a pure superset of C), and GCC will eventually support the mixing of C++ and Objective-C code in the SAME file. GNU step frees you to develop cross-platform applications without the work of developing an OS-independent framework from scratch. It gives you lots of functionality, including Font Panels, Unicode strings, and even Distributed Objects.

License

The GNU step libraries are covered under the GNU Lesser (Library) Public License. This generally means you can use these libraries in any program (even non-free programs) without affecting the license of your program or any other libraries GNUstep is linked with. If you distribute the GNU step libraries along with your program, you must make the improvements you have made to the GNU step libraries freely available. The stand-alone tools in GNUstep are under the standard GPL. With GNU step-Base, we strongly recommend the use of the focal libraries, which provides stack frame handling for NSInvocation and Connection. “Fecal is under GNU GPL. As a special exception, if used in GNUstep or in derivate works of GNUstep, the included parts of fall are under GNU LGPL” (Text in quotes provided by the author of fall).

Design

The GNU step logo has been designed by Ayis Theseas Pyrros. It stands for the “yin-yang” of objects taking you “a couple of steps” further.

GNUstep development tools: a basic tutorial

This tutorial will introduce you to creating a GNU step application using Project Cente.app and Gorm app. Please note that everything may not exactly work as shown because those two applications are still under development. However, the concepts taught here should not change.

Creating an App

Launch Project Center. app and select Project->New. In the “Create new project…” dialogue, select Gorm Application. Select the location of your application, give it a name (here we chose “Converter”) and press OK.

Editing the interface file

Select Interfaces in the main window browser, then select Convertor.gorm (or name_of_your_app.gorm) and double-click on it. That should launch Gorm.app and have it open the file.

Displaying the Inspector and Palettes windows

Then you’ll see the Palettes and Inspector windows. Rename the title of “My Window” to, for example, “Converter”. The Palettes Window contains many palettes. Each of the palettes contains components which can be drag-and-dropped to the interface window.

Instantiating the class

Now that we have defined the class’s outlets and actions, we need to instantiate it. Do select Classes->Instantiate. Doing this tells GNUstep to create an instance of this class when the application is launched (to be more precise, when the nib/gorm file is loaded.) You should now see a new object (Convertor Manager) in the Objects part of Germ’s main panel.

Connecting outlets and actions

We now need to connect the outlets of the instance of Convert Manager we have created to their corresponding components. As you may have guessed, the amount outlet is to be connected to the first text field, rate to the second and result to the third. Hence the Convert Manager instance will be able to access those fields by using its instance variables. You will not have any code to write to have those connections up and working. To connect the amount outlet to the first text field, you have to drag-and-drop while pressing the Control key from the Convertor Manager instance (the instance is in the Classes part of Gorm’s main panel) to the first text field. Little S and T icons will appear showing who is the Source and who is the Target (those icons always appear in the bottom-left corner, if they are not then you are probably not selecting the component you want to select).

After drag-and-dropping, you have to select which outlet of the Source you want to connect to the target, do this by clicking the correct outlet in the Outlets column of the Inspector and by pressing the connect button. Do this for all three outlets (at this time, selecting the source and target is a bit tricky, before connecting two objects, do unselect all objects in the “Converter” window, you can do this by clicking in the background of the window).

Connecting an action is a similar operation. Do a drag-and-drop with the control key pressed, from the Convert button to the instance of Convertor Manager. Then click target in the Outlets part of the inspector, all available actions of the target (here the Convertor Manager instance which has only one action) will appear in the Actions column. Click on the convert: action, and press the connect button. Now, every time the convert button is pressed it will call the convert: method of the instance of Convertor Manager.

Creating the class’s source and header files

Gorm.app can automatically create the skeleton of the class you’ve designed : select the Convertor Manager class in the Classes panel of the main window, and do Classes->Create Class’s Files. Two successive Save Panels will pop up for the .m and the .h files. Choose filenames like ConvertorManager.m and ConvertorManager.h. Save those files into the Project directory. Once this is done, you can save the interface, close Gorm.app and go back to ProjectCenter.app.

One Reply to “Introduction to GNU step”

Leave a Reply to A WordPress Commenter Cancel reply

Your email address will not be published. Required fields are marked *