By the way, I confirm that it is an actual bug in the Lib:



- modifying the Sample appli Formats (FormatsPanel.c) as


  /* ------------------ PanelPickListDrawItem func --------- */
  static char marre[128]; //+

  static void PanelPickListDrawItem (UInt itemNum, RectanglePtr bounds,
                                CharPtr *unusedP)
  {
    CharPtr itemText;
        
    StrPrintF (marre, "Item %d", itemNum);
    //--removed--itemText = panelIDsP[itemNum].name; //-
    WinDrawChars(marre, StrLen(marre), bounds->topLeft.x,
                bounds->topLeft.y); //changed

        // the draw func is changed in the way that neither
        // the resources nor the number of item matter.
        // it displays now the item number...
  }

/* ------------------ CreatePanelPickList func ------------ */

  CreatePanelPickList (...)
  {
        ...
    LstSetHeight (listP, 12 /*was 'panelCount' */);
    LstSetTopItem (listP, 2967);
        ...

        // We get the exact same problem! List is blank.
        // If Height is set to something else than 12, let say
        // 8 as it was at the beginning, it works fine (maybe
        // another magic Top item number would fail as well).
  }

So, with Top item being 2967, and Height of list being 12, the items are simply not displayed - or rather erased!

Ok, I will use a table - but it's funny: the List works fine, it does not crash, neither it fails ; items can be selected, but for those particular numbers (2967, 12), the list won't display at Init !


Thanks Ben.



Ben Combee wrote:


At 08:39 PM 10/28/2003, Axel Bernard wrote:

Hi all,

i'm back on the subject as i'm stuck right now.

Our program

- display a list of 2979 items (strings), 12 visible items
- using our own Draw function through LstSetDrawFunction

- when LstSetTopItem () is set to 2967 (ie top of last page) the list is displayed a microsecond then is erased - i.e. the 12 lines become blank. Even the top and down arrows in the list disappeared.



OK... if you've got more than 100 items, a list is an inappropriate control to show your data. It doesn't support browsing and finding items quickly. You'd do much, much better using a table, possibly with a scroll bar, and some sort of index mechanism. The "little arrow" UI is just too difficult to handle and navigate for that many items, IMO.





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

Reply via email to