On Wed, 2003-08-13 at 12:32, Toshiro V wrote:
> I have a dynamic list visible in the main form of an
> application. I want to be able to add items to this
> list (pressing a button, for example). I've been
> trying to do this but failed :( (I tried to use a
> callback draw function and it displays the list nicely
> the first time, but the list did not refresh when I
> add new items).
> 
> Anybody knows how to do it? (any hint/suggestion will
> be welcome :)

You didn't really say how it failed...but I'm assuming that the list
continues to work as it did before with fewer items than you wanted,
right?

If that's the case, then it sounds like you need to let the Palm know
that there's more items in the list.  I have this code called both in my
frmOpenEvent, and in a custom event I've created that indicates that the
list needs to be reloaded:

----------------------------------------
// assume that 'newNum' is the number of items you want to now display

// This sets the number of visible items in the list.
if (newNum<7) {
        LstSetHeight(listP,newNum);
}

// This tells the list you don't have any strings to draw in it, and
// also that the list is newNum items long.
LstSetListChoices(listP,NULL,newNum);

// Here's where you'd set your list drawing function if need be.

----------------------------------------

-Ken



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

Reply via email to