home *** CD-ROM | disk | FTP | other *** search
- #define __USE_SYSBASE=1
- #include <proto/listbrowser.h>
- #include <gadgets/listbrowser.h>
- #include <proto/exec.h>
- #include <exec/memory.h>
-
- struct List *
- EditBrowserNodesA( STRPTR *labels )
- {
- struct TagItem ti[5];
- struct List *l;
- struct Node *n;
-
- /* allocate a simple 1 column ListBrowser list from a label array */
-
- if (!labels)
- return NULL;
-
- if (!(l = AllocMem(sizeof(struct List), MEMF_PUBLIC|MEMF_CLEAR)))
- return NULL;
-
- NewList( l );
-
- ti[0].ti_Tag = LBNCA_Text;
- ti[1].ti_Tag = LBNCA_CopyText; ti[1].ti_Data = TRUE;
- ti[2].ti_Tag = LBNCA_MaxChars; ti[1].ti_Data = 39;
- ti[3].ti_Tag = LBNCA_Editable; ti[3].ti_Data = TRUE;
- ti[4].ti_Tag = TAG_END;
-
- while (*labels)
- {
- ti[0].ti_Data = (ULONG)*labels;
- if (!(n = AllocListBrowserNodeA( 1, ti )))
- break;
- n->ln_Name = *labels++;
- AddTail( l, n );
- }
- return l;
- }
-