listbrowser.gadget/SetListBrowserNodeAttrsA listbrowser.gadget/SetListBrowserNodeAttrsAer.gadget/SetListBrowserNodeAttrsA LBNCA_CopyText (BOOL) Specifies that you want the LBNCA_Text copied to an internal buffer by ListBrowser. This tag must precede LBNCA_Text in the tag list. For example, ... LBNA_Column, 2, LBNCA_CopyText, TRUE, LBNCA_Text, "Amiga", // Text will be copied
What is the advantage of usingt this TAG when creating a node list
node = IListBrowser-> AllocListBrowserNode(1,
LBNCA_CopyText, TRUE,
LBNCA_Text,Buffer,
TAG_DONE);
over just
node = IListBrowser-> AllocListBrowserNode(1,
LBNCA_Text,Buffer,
TAG_DONE);
???
The obvious thing to my mind is that you don't need to keep your strings in memory and can free up the memory used. Of course if your strings are inside your code as normal constant char pointers then it has no main advantage.
However, say you load your labels from disk (perhaps in different languages), or generate them on the fly from a directory scan, then the string can be copied and the memory used for those labels freed or reused by the code. :-)
If your buffer stays valid while the node lives, there is no advantage, it's rather a waste of memory.
But if your buffer is volatile, you cannot live without copying it into permanent memory.
Example: