On Mon, 04 Aug 2003 16:32:34 -0400, Douglas Handy <[EMAIL PROTECTED]> wrote:
>Bullshark,
>
>>>Ken's right.  Specifically, you *can't* use LstGetSelectionText with a
>>>dynamic list, so don't.  
>
>That should probably read you *can't* use LstGetSelectionText when you supplied
>NULL as the itemsText pointer to LstSetListChoices.

Yes, it certainly *SHOULD*, because as stated, it is out and out wrong.

>>If all that is involved here is a dynamic list, a DrawList callback 
>>is the wrong way to do it. 
>
>Personal opinion.  Earlier, a link was made to a "recipe" on the Pam OS site
>which describes static content lists, dynamic content lists, and custom-drawn
>content.  (See http://www.palmos.com/dev/support/docs/recipes/lists.html#dynamic
>for example.)

You really need to read for context: What was the FIRST CLAUSE of my
statement?

The article is misleading, and subject to interpretation.
There is no need to "remember" to deallocate the list at
form close time, unless the form is so trivial that it is
never revisited..."lazy instantiation (and deallocation)" takes care 
of this.

The method for allocating the list used in the article is terrible
The entire chunk can be allocated and deallocated in one call. 
Repetitive calls to memptrnew/free were positively gross, and I guess,
purpose built to suit the agenda of the author. That method would make
the worst possible case for memory waste as well. I seriously
suspect that the author of that "Recipe" is not a "Cook".

The article is a near total waste of electrons.

The simple truth of the matter is that if you need the text from 
the list (As the OP for this thread does), DrawList is the 
Wrong Way to Do it. IFF your list corresponds one to one with
DB records AND the DB records have the text *exactly* as needed
AND the list is not frequently used AND the list is not large,
then the DrawList is an acceptable substitute.


> In many cases, a drawlist is a trivial way to do it.

On that we agree. Trivial programs should benefit.

>by simply
>using the item number to map to a record index in the database, grab the data,
>and draw it.

That's pretty convenient. You only always display everything. What happens
when your list data is not from sequential records, or does not map to
a database record?

What a lot of work for every tap on a list.

It's you program do as you like.

In the mean time I will state my opinion as I see fit.

bullshark


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to