Palm OS Programming With NSBasic (cont.)
Our First Step, A GUI
With the introduction out of the way, we'll begin working on developing a very simple drawing application for the Palm OS.
The first step in our tutorial is the layout of a GUI for our application. When we open NSBasic to create a new file,
we are left with something very close to Figure 1. First, we should rename Screen1004 to NSDraw. This can be accomplished
by using the project explorer. If you right-click on Screen1004/Screen1004(), you will be presented with an options box that looks
something like Figure 2.
Figure 2: Screen Properties
You need to make changes to the Screen Name and Screen Title. You can name these whatever you would like,
but I have chosen NSDraw for both entries. Clicking on Done will send you back to the IDE.
Our project will have the ability to draw lines, rectangles and circles. The default drawing will be that of a line, with check
boxes available for the rectangles and circles options. To finish off the GUI, we need to place the appropriate check boxes and
a button for clearing the drawing. The button and checkbox objects are available in the toolbar.
When you click and drag an object from the toolbox, a default name and properties are given. These can be altered in much the
way we earlier altered the properties for our screen. For instance, right clicking on the first check box you place will give
you a Properties window. You can alter the rectangle checkbox to match those of Figure 3, and the circle checkbox and clear button
also need to have their respective properties altered.
Figure 3: Checkbox Properties
When you have altered their properties, place them in the approximate locations shown in Figure 4.
Figure 4: Control Alignment
Next: Let's Write Some Code
|