List box format - %n.mls

This format supplies a simple list-box facility. The corresponding arguments are an array of CHARACTER strings, an INTEGER argument giving the size of the array and an INTEGER argument that both sets the initial selection and returns the result.

For example:

   INTEGER k
   CHARACTER greek(4)*5
   DATA (greek(i),i=1,4)/'alpha','beta','gamma','delta'/
   k=1
   i=winio@('Select a Greek letter: %7.3ls',greek,4L,k)
   END

The characters "7.3" before "ls" specify the width of the list box (as the number of characters) and the depth of the list box (as the number of lines). Pre-setting k to 1 would cause "alpha" to be already highlighted when the window is displayed. If the user selects "beta", then k set to 2. If k were pre-set to zero, none of the items would be initially selected. If the user were to exit without making a selection, k would keep its pre-set value.

The grave accent (`) may be used with %ls to produce a drop-down combo box rather than a list box (for an editable combo box see %el (Editable Combo Box) ). The caret (^) character is used in association with a call-back function. This function will be called whenever an item is selected.

For example:

  EXTERNAL ls_function
  i=winio@('%^ls',array,6L,n,ls_function)

(See also the LISTBOX_ITEM_SELECTED parameter in clearwin_info@).

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited