A Simple Application—OReilly Starter

Now it’s time to apply what you just learned about an application’s interaction with the OS, its PilotMain routine, and the event loop to an actual application. We are using OReilly Starter, the application we first discussed in Chapter 4.

What the Application Does—Its User Interface

Our OReilly Starter application has two forms. On the first form, there are two buttons. Pressing the first one causes the Palm device to beep. Pressing the second button switches the view to the second form. The second form has a single button that returns to the previous form (see Figure 5-3). This is all there is to our simple application.

The OReilly Starter application
Figure 5-3. The OReilly Starter application

An Overview of the Source Files

Here are the source files that make up this application (as opposed to the tools-specific files like CodeWarrior .mcp files or PRC-Tools .def files).

Main.c

This file contains the main entry point (PilotMain) of the application. It also includes the event loop, application startup and shutdown code, and the code to load forms as needed.

MainForm.c

This contains the code that handles everything that occurs in the first form.

SecondForm.c

This contains the code for the second form.

Utils.c

This contains some utility routines that can be used throughout the application. You can include this same source file in all your applications.

Resources.rcp

This PilRC ...

Get Palm OS Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.