Home  /  Autodocs  /  ListBrowser.gadget

NAME

AllocListBrowserNodeA
Allocate a ListBrowser node.

SYNOPSIS

struct Node * AllocListBrowserNode(UWORD, Tag, ...)
node = AllocListBrowserNode(columns, Tag, ...)

struct Node * AllocListBrowserNodeA(UWORD, struct TagItem *)
node = AllocListBrowserNodeA(columns, taglist)

FUNCTION

Allocates a node that can be added to the Exec linked list of labels in the listbrowser. This is the only way to allocate a node for this list, you cannot allocate nodes yourself because the ListBrowser class uses a private node structure.

TAGS

See SetListBrowserNodeAttrsA() for the list of supported tags. In addition, AllocListBrowserNodeA() supports the following additional tags:

LBNA_NodeSize (ULONG) (V41) The size in bytes of the public portion of the node structure that should be allocated. Usually the default (sizeof(struct Node)) will suffice, unless you wish to have a custom node structure embedded within the ListBrowser node, in which case you'd provide the size of that structure. Then the node returned can be treated as an instance of your custom node structure.

Defaults to sizeof(struct Node).

LBNA_MemPool (APTR)
(V42) The size in bytes of the public portion of the node structure that should be allocated. Usually the default (sizeof(struct Node)) will suffice, unless you wish to have a custom node structure embedded within the ListBrowser node, in which case you'd provide the size of that structure. Then the node returned can be treated as an instance of your custom node structure.

Defaults to sizeof(struct Node).

INPUTS

columns
How many columns your ListBrowser has.

taglist
Attributes for the node, passed onto SetListBrowserNodeAttrsA().

RESULT

node
A node that can be added into the Exec list of labels for a ListBrowser gadget.

BUGS

The use of the LBNA_MemPool tag is strongly discouraged because no arbitration mechanism for safely allocating/freeing memory from the supplied pool is available in AmigaOS versions prior to AmigaOS4. This feature was never ever safe to use on AmigaOS versions 2.x through 3.x!

Never use LBNA_NodeSize with a size smaller than sizeof(struct Node) or data corruption is likely to occur.

SEE ALSO

FreeListBrowserNode(), SetListBrowserNodeAttrsA()