Gsharp Applications in 5 minutes

GUI Objects

In the same way that each plot of Gsharp is made up of several graphical objects (viewports, graphs, titles and notes) so is the interface of Gsharp made up of GUI objects (menus, toolbars, canvas and command line).

The full list is as follows Panel, Menubar, Menu, Button, Separator, Toolbar, Icon, Canvas, Command, Dialog, Bulletin, Label, Switch, Text, Combobox and Popup.

You can create and destroy GUI objects using GSL. e.g.

create Menu gsharp_1.menubar.MyMenu;
create Button gsharp_1.menubar.MyMenu.Run;
destroy gsharp_1.menubar.MyMenu

In fact the default Gsharp interface is created by a GSL file called $UNIDIR/base/Gsharp.gsa. It is possible to edit this file to add your own menus and dialogs.

Gsharp Applications

Its possible to create your own interface rather than using the default one. To do this you must create a file containing the commands to create your interface and save it in a file with a .gsa extension.

When Gsharp runs it will use your .gsa file instead of $UNIDIR/base/Gsharp.gsa

On UNIX and VMS you must use the command:

Gsharp myapp.gsa

On Windows you can just double click on it.

If you want to use parts of the default Gsharp interface in your own application you can just borrow code from $UNIDIR/base/Gsharp.gsa

GsharpApp

If you create an application which does not use any of the Gsharp tools such as the resource editors, the ScriptBuilder, the DataManager and the Browser then this application can be run using GsharpApp.

GsharpApp and Gsharp are separate executables. GsharpApp does not contain any of the Gsharp tools (Browser, DataManager, ScriptBuilder, Resource Editors) and so is smaller. A license for GsharpApp costs less than a license for the full Gsharp product.

To run using GsharpApp on UNIX or VMS you must use the command:

GsharpApp myapp.gsa

On Windows you can just double click on your .gsa file. The Gsharp InstallShield will setup Windows so that .gsl files are run by Gsharp and .gsa files are run by GsharpApp.

N.B. GsharpApp will run using a Gsharp license if no GsharpApp licenses are available.

The Object Hierarchy

The GUI objects are created in a hierarchy in the same way as the graphical objects.

Their can only be one Panel object and it is created automatically and called gsharp_1.

The Panel can contain any of the following objects - a menubar, up to two toolbars, a canvas and a command line. Full details of which objects can belong to other objects is described in the Gsharp Applications Reference Manual

Just like graphical objects, each GUI object has a set of resources describing it. Most objects have the following resources: XuNguiHeight, XuNguiWidth, XuNguiPosition, XuNguiSensitive. Each object will also have a number of resources specific to it, e.g. a Dialog has XuNguiDialogType and a Text object has a resource XuNguiMultilineEdit. The Gsharp Applications Reference Manual contains a full list of each object's resources.

Return to Gsharp Applications Home Page