Reference Guide > W Routines > WtList Function
  

WtList Function
Controls the characteristics of scrolling list widgets.
 
note
Making piecemeal changes to large lists requires multiple memory allocations and can result in repeated redraws of the list contents as each change is made. To avoid this, write your code so changes are made in bulk using one of the following methods:
*WwSetValue: this method always uses bulk changes.
*WtList: delete the entire list with the 'DeleteAll' function and update with the 'Add' function
*WwListUtils: delete the entire list using the Delete keyword in conjunction with the All keyword and then update the list using the Add keyword.
In general it is much more efficient to delete and replace the entire list in two operations than it is to iteratively remove or replace many individual items in an existing list.
Usage
status = WtList(function, widget[, parameters])
Parameters
function:
*'Add' — Add specified item(s) to the list.
*'Delete' — Delete specified item(s) from the list.
*'DeleteAll' — Delete all items from the list.
*'Deselect' — Deselect specified item(s) in the list.
*'DeselectAll' — Deselect all items in the list.
*'ItemCount' — Number of items in the list.
*'Items' — Get items in the list.
*'Select' — Select specified item(s) from the list.
*'SelectAll' — Select all items from the list.
*'SelectedCount' — Number of selected items.
*'Selected' — Get selected items.
*'Replace' — Replace specified item(s) in the list.
widget — The list widget ID.
parameters:
*For 'Add' — (p1) A string or array of strings; (p2) a long integer representing the position at which to add the item. The default is the end position.
*For 'Delete' — (p1) A string or array of strings.
*For 'Deselect' — (p1) A string or array of strings.
*For 'ItemCount' — (p1) Number of items in the list (long, output).
*For 'Items' — (p1) Items in the list. Array of strings (output).
*For 'Menu' — (p1) Menu shell ID (long).
*For 'Select' — (p1) A string or array of strings.
*For 'SelectedCount' — (p1) Number of selected items (long, output).
*For 'Selected' — (p1) Selected items. Array of strings (output).
*For 'Replace' — (p1) A string or array of strings; (p2) position of first items to be replaced.
Keywords
Notify — If specified, a callback is called during Select or Deselect operations.
Discussion
The list utility lets users choose an action from a list of actions. For detailed information on the list utility, see the description of XmList in the OSF/Motif Programmer’s Reference.
 
note
Rogue Wave has ported a subset of the Widget Toolbox (Wt) functionality available for Motif to Microsoft Windows. Because the Widget Toolbox under Windows is not a complete implementation, we recommend that Windows developers use the PV‑WAVE Widgets (Ww) layer or the VDA Tools when developing GUI applications.
Example
.
.
items = ['Presidents Day','St.Patricks Day', 'Easter', $
   'Memorial Day', '4th of July', 'Labor Day', 'Halloween', $
   'Thanksgiving', 'Hanukkah', 'Christmas', 'New Years Eve']
status = WtList("Add", datelist, items)
.
.
See Also
WwListUtils
For detailed information on GUI development, refer to the PV‑WAVE Application Developer’s Guide.
For more information about how to write an application program based on the PV‑WAVE Widget Toolbox, refer to Using the Widget Toolbox in the PV‑WAVE Application Developer’s Guide.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.