Matt Graham wrote:
Wilson, Mike E. wrote:
I have looked at all the documents on the Palm website for complete code examples for the How To Do This level. I have found nothing really comnplete. Most documents are API references and Simple "this is what this control does functionally". I have not been able to find any Cookbooks or Complete Code examples even in some of the books. I own Palm OS Programming 2nd Edition by O'Reilly and have access to the Palm Programming Bible through my at work online training (24 X 7 Books). Both are good, I am still wading my way through it but I can't understand why it is so hard to just find examples that show if you want to use this control (pushbutton) for example here is a simple example of how to Set it, Read It, and than do some action based upon it. I have programmed in VB, C, HTML, PHP, Javascript, etc. and have always been able to find hundreds of cookbook or examples to grasp the concepts and move on. This does not appear to be true for the Palm. Why?
What's wrong with the API reference?
Not exactly wrong, but let's face it, it's quite boring to read. In my opinion, there should be examples in the documentation. It's easier to understand how a funcion works, what she does and how to use it. Ok, you have examples in the site, but you have to stop reading the documentation, open a browser, search for the examples... not very productive.
Not convinced? Let's see an example (they always help):
CtlGetLabel Function
Purpose: Return a character pointer to a control s text label. Declared In Control.h
Prototype: const Char *CtlGetLabel (const ControlType *controlP)
Parameters:
controlP -> Pointer to control object. (See ControlType.)
Returns: Returns a pointer to a null-terminated string.
Comments: Make sure that controlP is not a graphical control or a slider control. The graphical control and slider control structures do not contain a text label field. See Also CtlSetLabel()
Ok, very good. But how do I get a pointer to the control? There isn't even a link to FrmGetObjectIndex, FrmGetObjectPtr, etc. Instead, they put a link to the ControlType structure, what doesn't help much. How many time will someone who has never worked with PalmOS to find out how to get a control's label? Such an elementary operation!
Luciano Stertz
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
