Help understanding the Picker example app?

Former Member
Former Member
Hi.

I'm trying to understand the picker app sample. I have managed to modify it to how I want it, except for retrieving values from the pickers as something I can use.

Please help me understand. The picker sample app uses a WordFactory that returns a Text Drawable. For some reason in the following code from the sample (if I'm allowed to post it here???), the setText() function seems to treat the 'prop' variable as a string:

[FONT=Courier New] prop = app.getProperty("date");
if(prop != null) {
date.setText(prop);
}[/FONT]

Yet the following fails:
[FONT=Courier New]var mystring = prop.substring(2, prop.length());

[/FONT]The the (object) toString() function also fails:
[FONT=Courier New]var mystring = prop.toString().substring(2, prop.length());
[/FONT]
How am I to retrieve the value from the picker as a string that I can use? Thanks in advance.


EDIT: I m guessing I'm asking how to convert a WatchUi.Drawable to a String (apparently it inherits the toString() method). Or where in the picker code should a set an Object Store string for the selected picker value.