Question

For example, let's say I am adding a set of objects I created, called myClass (which contains a string) to myList and then I wish to use the list and pass it to a GUI list. Is there a way to populate that GUI list only with the value of that string in myClass?

Was it helpful?

Solution

Every object should respond to printString message with some meaningful string presentation of itself. You can write your own #printString for your object and use it.

Even better for your case could be implementation of asString conversion method, which converts your object to a string.

OTHER TIPS

I believe the methods you are looking for are printString and/or displayString.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top