[Newbies] Newbie seeks advice for working with connectors

Ian J Cottee icottee at bluefountain.com
Wed Sep 10 06:56:27 UTC 2008


On Tue, Sep 9, 2008 at 9:39 AM, Edgar J. De Cleene
<edgardec2001 at yahoo.com.ar> wrote:
>
>
>
> El 9/9/08 4:45 AM, "Ian J Cottee" <icottee at bluefountain.com> escribió:
>
>> 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
> See my LogicCircus
> http://wiki.squeak.org/squeak/5991
>
> Click on picture and download the .pr
>
> It's a very bacic Logic Gates simulator, which "wire" components when you
> click from first to second.
> If you study , could solve some of your needs IMHO.
>
> Edgar

Many thanks for the pointer Edgar. I've installed and taken a look.
It's obviously a lot easier to understand as a unit than the
Connectors framework and if I don't make any progress I may well use
your simulator as a starting point instead.

I'll let you know how I get on :)

Many thanks again

Ian


More information about the Beginners mailing list