Note: This describes the full CocoaBasic version

Getting Started with CocoaBasic

The Project Window

There is a Main Project window called "Project Browser" as shown here.

Screen Shot

It is separated into two parts with tables (lists) with three columns each: If you don't have much experience with object oriented programming yet, think of the classes as structured data types (records, structs) with associated functions and operators (called methods) and the instances as pre-initialized variables of a one of these structured data type.

The following actions are possible in the main window:

Creating Instances

To create objects (Instances) of a certain type, select the type (class) in the leftmost column. Then, select File/New Instance from the File Menu. This will automatically add a new Instance to the Instance list.
Then double-click into the new Instance and the Instance Editor opens.

Creating Windows

A Window is simply a predefined Instance of the Class "NSWindow" together with its NSViews. You can create a new window with the File/New Window menu. In this case, the Window Editor opens.
If you later on want to edit the Window in the standard Instance Editor, press the alt key while double-clicking.

Creating and Editing Instances

Description forthcoming.

Creating and Editing Subclasses

Description forthcoming.
In object oriented programming, you can define your own data types by extending existing classes. A new subclass inherits all properties and methods from its superclass.

A Hello World example

  1. First, start CocoaBasic. This will open a fresh project.
  2. Select File/New Window. A new Window will appear.
  3. Scroll the Class Browser until you can see the NS??? entry. Select this entry and drag it to the window. There it will change into a text field. Additionally, a new instance is created.
  4. Either select the instance in the Instance Browser, or the object in the Window and double click. This will open the Instance Editor.
  5. Locate the Property "????". Click into the Value column. There, you can now enter and edit the contents.
  6. Save the project (File/Save or apple-S). A selection dialog appears where you can select the project name. Keep the file suffix (.ccbas).
  7. Select File/Build Application. A Build dialog appears. Enter the application name "HelloWorld" and press the Build button.
  8. After this, you will find the HelloWorld application in the same folder (directory) as you have saved the project file.
  9. Double click in the Finder on the HelloWorld application and voila, it opens.
  10. You may also open the Preferences Pane and check "create Application in Applications folder". Then, you will find the HelloWorld application in your private Applications folder.

How it compares to Project and Interface Builder

Basically, CocoaBasic combines the functionality of both, project builder and interface builder into a single application. Classes are initialized with all classes that are contained in the Cocoa Framework, classes loaded from Plugins. The user-defined classes are stored in the CocoaBasic project file.

What happens when building an application

When building an application,

Last Change: 11 Mar 2003 - ©hns@dsitri.de, 2003