[Newbies] Newbie seeks advice for working with connectors

Ian J Cottee icottee at bluefountain.com
Tue Sep 9 07:45:08 UTC 2008


Hi all

I've spent the last month or so working through the Squeak By Example
book and now need to actually try to do something in order to make it
all gel in my mind. My current requirement seems quite 'simple' to
describe but I am not quite sure where to go from here.

For a very simple first step I want to take two text boxes, draw an
arrow between them and then, when I switch the box 'on' - box1 will
send an item (represented as a simple shape) along the arrow to box2.
When it reaches box2, box1 will send the next. As each item reaches
box2, box2 will be doing 'something'. This is the first stage of
modelling a production system where items are sent from machine to
machine down a production line.

I've found the Connectors framework which solves the problem of
drawing boxes and linking them together. What I can't work out is that
if I have a box, how do I know what arrows are connected to it? How do
I know if the arrow is pointing out of the box or into the box (so
should I be sending down it or receiving through it) and how do I
animate that arrow to show an item passing down it?

I guess the main question is (first of all) just working out what
arrows are joined to a box. Having browsed through the classes
NCTextRectangleMorph (my current box class) and NCAAConnectorMorph (my
current arrow class) I'm none the wiser. Is there any documentation
for programming the Connectors framework? I've googled but turned
nothing up so far.

Any pointers/advice gratefully received.

Ian


More information about the Beginners mailing list