|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hello World! (continued)
The ctlSelectEvent marches through the event handlers until it too is handed to MainFormHandleEvent(). MainFormHandleEvent() handles it by displaying "hello again" as shown in Figure B and returns indicating "event handled."
FIGURE B
This is what it looks like after pressing the "hello again" button.
Again, the event loop asks for the next event, and Palm OS waits for the next one to occur.
Billions and billions of little events Event after event, our little PalmPilot does its work. You can see how much goes on just to display a simple form with a few simple controls. Imagine how much goes on to do real work!
Fortunately, it gets somewhat easier. If you look at the processing for the "hello again" button, it's minimal compared to the basic program structure. Once the program skeleton is working, controls and forms are added relatively easily. For example, you could easily add the about screen shown in Figure C.
FIGURE C
This is the application's "About" screen.
Resources: defining the forms and controls Each program includes "resources" which define the forms and controls used by that program. The program's icon is another resource; text strings may also be attached as resources.
We'll cover resources more completely in future columns, but we need to touch on them a bit here.
CodeWarrior and GCC build resources in quite different ways. CodeWarrior uses a graphical "drag-and-drop" tool called Constructor. You build each form by dragging controls from the "catalog" and placing them on the form, then configure the control as necessary (size, text, etc.). When you save it, Constructor automatically creates the header file with the ID numbers.
GCC uses a text script and Wes Cherry's PilRC utility. PilRC takes the text script and builds the resources.
Unfortunately, the methods are incompatible; there are no tools for creating CodeWarrior resources from a PilRC script, nor vice-versa. We'll examine creating CodeWarrior and GCC resources in upcoming columns.
In Conclusion We've covered a lot here, but once the event loop makes sense you're well on your way to writing PalmPilot programs. Next month we'll start looking at controls and resources in detail.
Alan Weiner works hundreds of hours each week writing software so he can retire early and spend the rest of his life in leisure - writing software. His email address is alan@ajw.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album -- and have them delivered right to your door!
Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!
And it's only from The Duck! Tap here to get started. |
-- Advertisement --
SECURE YOUR SITE WITH AN IRONCLAD SSL CERTIFICATE
An IronClad SSL Certificate helps you build an impenetrable fortress around your customer's credit card information. IronClad SSL Certificates are:
- Fully validated
- Up to 256-bit encryption
- Up to 10 years validity
- Stringent authentication
- Around-the-clock customer support
Build trust. Protect your customers. Grow your online business.
Tap here now and be IronClad with SSL tonight. |
|
|
|
|
|
|
|
|
|
|