The Application Object: 1 GenApplication Basics

Up: GEOS SDK TechDocs | Up | Down | Prev: The Application Object | Next: 2 Advanced GenApplication Usage

The top-level generic object of your application must be a GenApplication object. You should place this application object within its own resource; this ensures that your application will take up little memory when minimized. Your application tree should branch from this single node. HelloApp from Hello World shows a section of Hello World to illustrate the typical use of a GenApplicationClass object.

Code Display 3-1 HelloApp from Hello World

/*			Application Object
 * The hello.gp file contains an "appobj" statement which indicates that this
 * "HelloApp" object is the top-level UI object. Note that the name of the
 * resource you place the application object in may be whatever you choose;
 * it does not have to be AppResource. */
@start AppResource;				/* Begin definition of objects in AppResource. */
@object GenApplicationClass HelloApp = {
    GI_comp = @HelloPrimary;
			/* The GI_comp attribute lists the generic children
			 * of the object. The HelloApp object has just one
			 * child, the primary window of the application. */
    gcnList(MANUFACTURER_ID_GEOWORKS, GAGCNLT_WINDOWS) = HelloPrimary; 
			/* The window's application GCN list determines which
			 * windowable children should be launched on
			 * startup. The primary window in most cases should be
			 * launched on startup.*/
}
@end AppResource				/* End definition of objects in AppResource. */

Typically, you will not subclass GenApplicationClass . You may occasionally send messages to it, but otherwise it exists primarily to interact with the User Interface.

Note that the Application object you set up in your .goc file must be reflected in the Geode Parameters file (the .gp file). The name of the Application object should appear in the appobj field of the .gp file.


Up: GEOS SDK TechDocs | Up | Down | Prev: The Application Object | Next: 2 Advanced GenApplication Usage