Hi!

I've got another newbie question.  I can not, for the life of me, figure
out how to make my list selectable.  I've looked through the demo apps,
but I can't seem to find one that has a selectable list.  I checked the
archives for this mailing list and found a posting about the file picker
dialog, but I still couldn't piece together the answer to my question.

I've got a box with a list (created using PG_WIDGET_LIST) and a
scrollbar in it.  My list items were created using PG_WIDGET_LISTITEM.

I'm pretty much completely stumped, and any help would be greatly
appreciated!

Thanks!
Davina



    /* create the list of memos and scrollbar */
    listbox = pgNewWidget(PG_WIDGET_BOX, PG_DERIVE_AFTER, appBar);
    list = pgNewWidget(PG_WIDGET_LIST, PG_DERIVE_INSIDE, listbox);
    scrollbar = pgNewWidget(PG_WIDGET_SCROLL, PG_DERIVE_INSIDE,
listbox);
    pgSetWidget(list, PG_WP_SIDE, PG_S_TOP, 0);
    pgSetWidget(scrollbar, PG_WP_BIND, list, 0);
    
    /* read the memopad dir and put memos in the scrolling list */
    dir = opendir(MEMO_DIR);
    entry = readdir(dir);
    while (entry) {
        if (strstr(entry->d_name, "memo")) {
            item = pgCreateWidget(PG_WIDGET_LISTITEM);
            pgNewWidget(PG_WIDGET_LABEL, PG_DERIVE_INSIDE, item);
            pgSetWidget(PGDEFAULT, PG_WP_TRANSPARENT, FALSE,
                        PG_WP_TEXT, pgNewString(entry->d_name),
                        PG_WP_ALIGN, PG_A_LEFT, 0);
            pgListInsertAt(list, item, numEntry++);
            pgBind(item, PG_WE_ACTIVATE, &evtListClicked, NULL);
        }
        entry = readdir(dir);
    }

    pgFocus(list);
    pgSetWidget(list, PG_WP_SELECTED, 0, 0);
    pgUpdate();

_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel

Reply via email to