bullshark wrote: > > The source code for the standard applets are testaments to "the > way".
Well, the sample Preference panel code uses the custom-drawn-list model... > That's a thought, but is it realistic? A search that has no control > over the content of the list to search has no control over the >order, > and no ability to search effectively. The callback would not even be > able to guarantee a constant set for the search in progress. Each > character addition would force a fetch of all text through the > callback...It would probably violate the 'instant/interruptable' > edicts right off the bat. The problems are manifold. Good points, but the current incremental search implementation puts the responsibility on the developer to ensure that the list is already sorted. Using a callback mechanism shouldn't be much different; the developer's responsible to make the necessary steps to make incremental-search well-behaved. > I've been writing for the palm for several years. I don't know when or > where this trend to use DrawList came from...I suspect it's attractive > to the novice C-Crowd that has a difficult time with pointers and > dynamic memory in general. I am fully capable of dealing with all that. However, it's a chore. Feeding LstSetListChoices a copy of your strings means that there are extra pointers to pass around, extra memory to remember to deallocate later, extra error checks for the extra allocation(s). It's not /hard/, it's just tedious and a bit more error-prone. (And by the extra pointers, I don't mean a separate allocation for each string (that would be silly). If there's data you want to associate with each list item, instead of a single array of structs, you now would need one array for the strings and another array for the corresponding values.) > ...Yeah but I'm not the one telling the Palm guys that they need > to change the API to suit my implementation (c; Well: 1. It's just a suggestion. 2. Based on the number of other replies, I think the custom-drawn-list is a fairly common usage pattern. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
