Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On Fri, 8 Aug 2003 11:32:23 +1000, Alan Ingleby [EMAIL PROTECTED] wrote: bullshark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes I am. Deallocating is: if(pListTxt != NULL) //pretty hard { memPtrFree(pListText); //huh? pListText=NULL; //?? } Sounds like you're using

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread Alan Ingleby
I doubt they'll every add it, since the existing API is capable of doing the job. Besides that, it's possible to simulate a text callback using the existing API.. Simply use the userDataP to hold your function pointer, then you only need to write one ListDraw function (which then calls your text

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On 05 Aug 2003 10:57:18 +0100, kcorey [EMAIL PROTECTED] wrote: On Tue, 2003-08-05 at 10:43, bullshark wrote: 2) Allocate an array from dynamic memory for the strings and copy all the strings into memory. That's the ticket. 'Dynamic'. Copy is what you do when you draw. The difference is that

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread James
Alan Ingleby wrote: I doubt they'll [ever] add it, since the existing API is capable of doing the job. If there is a simple way to have incremental-search with the existing API without passing the actual text to LstSetListChoices, please elaborate. Besides that, it's possible to simulate a

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On Tue, 5 Aug 2003 19:42:13 -0700 (PDT), James [EMAIL PROTECTED] wrote: Alan Ingleby wrote: Besides, if you want incremental search, your list is probably going to be pretty huge, so trying to manage it with ListSetListChoices is going to be nasty. How is that? The beauty of a loop is that

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread James
Alan Ingleby wrote: Ahh... Ok. Yes, the API is never going to give you that functionality... If you have a call in your code which will return the text for a given index, it's not hard to get this functionality anyway. I have this feature in many of my custom-drawn lists, and support it

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread Douglas Handy
Bullshark, I think too much is made of this. A list of 500 items with an average width of 10 characters consumes 7500 bytes. Is this a big deal? It amounts to .3% of the memory available on a lowly PIII or Zira. Yes, it's true that a palm chock-full other programs and records brings the ceiling

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-14 Thread bullshark
On Fri, 08 Aug 2003 14:17:36 -0400, Douglas Handy [EMAIL PROTECTED] wrote: Other programs and records has nothing to do with it. That affects the storage heap size, not the dynamic memory size. Every Palm OS has the total memory allocated by the manufacturer with a fixed allotment between

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-09 Thread James
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

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-09 Thread Douglas Handy
Bullshark, why haven't I ever run out of heap? *Ever*? In part because you (correctly) don't use lists for things with a large number of elements. I don't either; I'd typically use a table with lookup in that scenario. I hardly ever write an application that uses static lists other than

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-08 Thread Ben Combee
Ah, but you see, incremental search is available only for popup lists (I'm not sure what the rationale is for that restriction), and you can't roll your own for those, because there's no means to intercept List events... Popup lists have their own modal event loops, which means they have a

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-08 Thread kcorey
On Tue, 2003-08-05 at 10:43, bullshark wrote: 2) Allocate an array from dynamic memory for the strings and copy all the strings into memory. That's the ticket. 'Dynamic'. Copy is what you do when you draw. The difference is that with a LstSetListChoices you have access to the list after you

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-07 Thread James
Alan Ingleby wrote: James wrote: If there is a simple way to have incremental-search with the existing API without passing the actual text to LstSetListChoices, please elaborate. Can you please clarify what you mean by incremental search.

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-07 Thread Alan Ingleby
James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Alan Ingleby wrote: James wrote: If there is a simple way to have incremental-search with the existing API without passing the actual text to LstSetListChoices, please elaborate. Can you please clarify what you

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-07 Thread Alan Ingleby
James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If there is a simple way to have incremental-search with the existing API without passing the actual text to LstSetListChoices, please elaborate. Can you please clarify what you mean by incremental search. Alan -- For

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-07 Thread Alan Ingleby
bullshark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes I am. Deallocating is: if(pListTxt != NULL) //pretty hard { memPtrFree(pListText); //huh? pListText=NULL; //?? } and there are at most two of those clauses for a dynamic list. Since one of those is in the

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-06 Thread bullshark
On 04 Aug 2003 14:55:54 +0100, kcorey [EMAIL PROTECTED] wrote: On Mon, 2003-08-04 at 14:53, bullshark wrote: On Mon, 4 Aug 2003 09:59:53 +1000, Alan Ingleby [EMAIL PROTECTED] wrote: Ken's right. Specifically, you *can't* use LstGetSelectionText with a dynamic list, so don't. What? Why

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-05 Thread bullshark
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

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-05 Thread Alan Ingleby
James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Exactly my point; for huge lists, you often don't want to use LstSetListChoices because you're retrieving the strings from somewhere else, and you don't want to deal with the extra memory requirements and management. Hence, the

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread bullshark
On Mon, 4 Aug 2003 09:59:53 +1000, Alan Ingleby [EMAIL PROTECTED] wrote: Ken's right. Specifically, you *can't* use LstGetSelectionText with a dynamic list, so don't. What? Why would that be? That's just wrong. This is only the case when a (suspicious) program never calls LstSetListChoices.

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread kcorey
On Mon, 2003-08-04 at 14:53, bullshark wrote: On Mon, 4 Aug 2003 09:59:53 +1000, Alan Ingleby [EMAIL PROTECTED] wrote: Ken's right. Specifically, you *can't* use LstGetSelectionText with a dynamic list, so don't. What? Why would that be? That's just wrong. This is only the case when

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread nmailey
: (bcc: Nole Mailey/pmc) [EMAIL PROTECTED]Subject: Re: LstGetSelectionText() - Memory Allocation ?!?! palmos.com

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread nmailey
) [EMAIL PROTECTED]Subject: Re: LstGetSelectionText() - Memory Allocation ?!?! palmos.com

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread Douglas Handy
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. If all that is involved here is a dynamic list, a

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-04 Thread James
I really, really wish Lists could have an application-defined callback to retrieve the text for a specified item. Here's how I envision it would work: typedef Char* (*ListGetSelectionTextFuncType)(const ListType* listP, Int16 itemNum, void* userDataP); void LstSetListChoices(ListType* listP,

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-03 Thread Alan Ingleby
Ken's right. Specifically, you *can't* use LstGetSelectionText with a dynamic list, so don't. Use your own code to determine the value. This shouldn't be hard, as it's effectively the same code you're using in your *DrawList function. Alan kcorey [EMAIL PROTECTED] wrote in message news:[EMAIL

LstGetSelectionText() - Memory Allocation ?!?!

2003-08-02 Thread nmailey
I've got my list generating dynamically... HOORAY! However now I'm trying to get the text that the user selects... I'm not sure what I'm doing wrong in the text memory allocation side of things or how to do it properly anyways...but I know that's my problem...

Re: LstGetSelectionText() - Memory Allocation ?!?!

2003-08-02 Thread kcorey
On Sun, 2003-08-03 at 00:32, [EMAIL PROTECTED] wrote: I've got my list generating dynamically... HOORAY! However now I'm trying to get the text that the user selects... I'm not sure what I'm doing wrong in the text memory allocation side of things or how to do it properly anyways...but I