The deprecated ListBox had a Property: CellValueAt.
As best I can tell, with the new DesktopListBox, this has been replaced with a Method: CellTextAt.
Var i As Integer
For i = 0 To Self.ControlCount - 1 // number of controls in window
ListBox1.AddRow(Str(i)) // first column
ListBox1.CellTextAt(Listbox1.LastAddedRowIndex, 1) = Control(i).Name // second column
Next
So we have this syntax:
ListBox1.CellTextAt(Listbox1.LastAddedRowIndex, 1) = someString
How is it that we are now assigning a value to the result of a Method?
If I had to guess, I’d say that it was a pair of method definitions before but was documented as a property. Could be wrong, though, as I don’t have access to the Xojo source or knowledge of how they documented things then versus now.
Anthony, thanks for the example. I had never noticed/comprehended this. I guess it is just something to get used to.
My confusion started when I got the message that Listbox2.CellValueAt was an error in the world of the new DesktopListbox. My instinct was to look at the Properties of DesktopListbox for the replacement because Listbox2.CellValueAt was a Property.
It turns out that the replacement is under the Methods of DesktopListbox: CellTextAt.
Language Reference: ListBox.CellTagAt.
" Gets or sets a “hidden” identifier associated with the cell identified by its parameters. Row and Column are zero-based."
You are correct. Many years ago (10+), getter/setter methods were listed as properties in the docs. With API 2 stuff we are listing them as the methods they truly are so that people realize 1) they won’t be shown in the debugger and 2) that they can be overridden.