Next: , Previous: BLOX.BDropDown-flexibility, Up: BLOX.BDropDown


1.12.4 BLOX.BDropDown: list box accessing

add: anObject afterIndex: index
Add an element with the given value after another element whose index is contained in the index parameter. The label displayed in the widget is anObject's displayString. Answer anObject.


add: aString element: anObject afterIndex: index
Add an element with the aString label after another element whose index is contained in the index parameter. This method allows the client to decide autonomously the label that the widget will display.

If anObject is nil, then string is used as the element as well. If aString is nil, then the element's displayString is used as the label.

Answer anObject or, if it is nil, aString.


addLast: anObject
Add an element with the given value at the end of the listbox. The label displayed in the widget is anObject's displayString. Answer anObject.


addLast: aString element: anObject
Add an element with the given value at the end of the listbox. This method allows the client to decide autonomously the label that the widget will display.

If anObject is nil, then string is used as the element as well. If aString is nil, then the element's displayString is used as the label.

Answer anObject or, if it is nil, aString.


associationAt: anIndex
Answer an association whose key is the item at the given position in the listbox and whose value is the label used to display that item.


at: anIndex
Answer the element displayed at the given position in the list box.


contents: stringCollection
Set the elements displayed in the listbox, and set the labels to be their displayStrings.


contents: stringCollection elements: elementList
Set the elements displayed in the listbox to be those in elementList, and set the labels to be the corresponding elements in stringCollection. The two collections must have the same size.


do: aBlock
Iterate over each element of the listbox and pass it to aBlock.


elements: elementList
Set the elements displayed in the listbox, and set the labels to be their displayStrings.


index: newIndex
Highlight the item at the given position in the listbox, and transfer the text in the list box to the text widget.


labelAt: anIndex
Answer the label displayed at the given position in the list box.


labelsDo: aBlock
Iterate over the labels in the list widget and pass each of them to aBlock.


numberOfStrings
Answer the number of items in the list box

would

removeAtIndex: index
Remove the item at the given index in the list box, answering the object associated to the element (i.e. the value that #at: would have returned for the given index)


size
Answer the number of items in the list box