[lively-kernel] Connections tutorial, Morphic: Connections

Fabian Bornhofen fbornhofen at googlemail.com
Wed Feb 1 20:39:40 CET 2012


Hi Blake -

clicking on the arrow (actually the line, not the head) is a problem,
and I'm glad you're reminding us of this.

As the arrow's line is horizontal, you need to be very precise to hit
it. A workaround is to move one of the text boxes so the arrow is not
exactly horizontal any more. If you then click on or near the line,
you'll get the right menu.
It's definitely a UI thing we need to improve.

As for the script editor: you can do that, too, and it looks like
you've almost made it work!
Open the script editor on the Fahrenheit text input. Then go to the
connections and click +, which gives you some template text. In order
to work, this needs to read

connect(this, 'textString', this.get('Celsius'), 'textString',
{converter: function(value) {return (value - 32) * 5/9;}});

The last parameter needs to be an object with a method named converter.
(Am I the only one to think that this could be more intuitive?)

Don't hesitate to ask if you're running into more issues.

Best,
Fabian

On Wed, Feb 1, 2012 at 11:02 AM, blake <dsblakewatson at gmail.com> wrote:
> Hi, there--
>
> On the page "Morphic: Connections" of the "Connections tutorial" it
> has you drag a connection between Fahrenheit and Celsius text morphs,
> using textString for both.
>
> I do this, it works, in that a change in the (F) changes the (C).
>
> Then it says, "To enter a converter function, right-click on the
> connection arrow and click 'edit converter'."
>
> So, assuming the connection arrow is that arrowhead-looking
> rightward-pointing triangle, when I right click on it, there's no
> "edit converter" option. There all all the usual morphic handles,
> including the object menu, which doesn't have a "edit converter"
> option.
>
> And there's "open script editor," which seems promising but it's
> empty, making: "In the editor window, change the text between { and }
> to " problematic.
>
> I can add a script, of course, but it won't be connected to--well,
> whatever it's supposed to be connected to.
>
> I can pull up the script editor for Fahrenheit, and I see
> textString.AttributionConnect[might be something after here but I
> can't read it because the connections pane doesn't want to resize] set
> to:
>
> connect(this, "textString", this.get("Celsius"), "textString", {});
>
> But if I put "return (value - 32) * 5/9;" there, I get "unexpected
> token" and lots of other red text. I can probably make this work but
> I'm assuming there's something I'm missing, or a typo in the tutorial.
>
> Thanks for any guidance!
>
> ===Blake===
> _______________________________________________
> lively-kernel mailing list
> lively-kernel at hpi.uni-potsdam.de
> http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel


More information about the lively-kernel mailing list