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.
Resources, forms and controls (continued)

Resources are just data structures
For the most part, we don't care about the resource's structure itself; just what capabilities that resource has, how we refer to the resource, and what we can do with it. String resources are just that: a text string. We can request a pointer to the string, and we can use the string (referenced via that pointer) or we can reference the string by another resource (as the 'help' message for a form, for example). Form resources are far more complex, but we simply refer to them by their identification number; we would call FrmGotoForm(1000) to go to form number 1000.

Each resource is identified by a resource type and an identification number. Palm has defined a number of resource types. Some of these will already be familiar to Macintosh programmers. Each resource type is a four-character name; the string resource above is 'tSTR'. The resource-development tools handle all the name issues for us, but it's useful to be familiar with them; occasionally you'll see reference to "a Talt" or "a tAIN" resource. The sidebar "Resource Types" lists many of the common resource types.

Forms are a collection of resources
Each of the controls on a form can be a resource by itself, but when they're built into a form, they become an integral part of the data structure defining that form. The form data structure contains information about the form itself (such things as height and width); the data structure for each control is concatenated to the form's structure.

Other resources, such as the help message or the form's menu, are separate resources within the application file but are referenced from the form's data structure. This all happens automatically. You don't need to do anything special to make this happen. You simply build a form using the appropriate tools for your development environment. The tools build the right structures.

Building Resources
CodeWarrior and GCC use different tools to build resources.

CodeWarrior provides a graphical utility called "Constructor" while GCC uses a text script and the PilRC utility. Unfortunately, there's no easy way to convert from one to the other. If you have a program written using one compiler, it's pretty easy to compile it using the other, but the resources need to be recreated manually.

Building resources with CodeWarrior's Constructor
While a complete tutorial on Constructor is beyond the scope of this column, the basics are described here.

You open a resource "project" which shows a list of the various resources for that application. Figure A shows the resource project for the "hello world" application. This project is different than the CodeWarrior IDE (Interactive Development Environment) project; the IDE project file uses an .MCP extension while the resource project is a .RSRC extension. The .RSRC file will be included in the IDE's project as a dependent file.

FIGURE A


Constructor displays the .RSRC file as a list of resources. Roll over picture for a larger image.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
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 --

ONLINE GROUP CALENDAR - FOR UP TO 100 OF YOUR CLOSEST FRIENDS
Stay organized and in control with 24/7 access to all of your important events, projects and files --whether you're at work, at home or on the road.

You can share your calendar, projects and files so everyone in your office is up to date. Plus, search your entire group to find times when everyone is available to meet, manage company resources and much more.

Organize your entire team for as low as $9.95 per year (and yes, that's where the decimal place is supposed to be!)

Tap here to get started right away.

-- Advertisement --

Sent Items Organizer
When you need to file your sent email into their proper folders based on keywords or who it's to. It's also perfect for shared mailboxes.

It also adds a "Send And File" toolbar button while you're composing (similar to the way Lotus Notes used to work) for quick and easy filing.

Find out more!

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