Search PalmPower's 487 Palm-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
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.

Product availability and resources
I've placed the source code (for both CodeWarrior and GCC) on my web site. You can download them at:

CodeWarrior version: http://www.ajw.com/PalmPower/ProgrammingPower/May98/cw.zip

GCC version: http://www.ajw.com/PalmPower/ProgrammingPower/May98/gcc.zip

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.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  6
Other articles you might like
Home > Phones and PDAs > Palm and Treo > Programming (24 articles)
   How PDA software is born
   Program with Simplicity
   Kinectivity 2.0 brings enterprise application developers new tools
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Other PalmPower Articles
Palm gets up to date with new Tungsten family of handhelds
Create handwritten email with riteMail
Presenter-to-Go puts PowerPoint presentations on your Palm OS handheld
Looking for the cutting edge
Gain remote access to databases and PLCs
PalmSource Open House showcases what's new in the Palm community
Analysis: handheld market share
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
DominoPower: Application development, William Shatner, and the origin of the universe
OutlookPower: More about disappearing text
-- 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.

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login