FW: how to hide ALL connectors to/from a specific node in the Connectors package?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: how to hide ALL connectors to/from a specific node in the Connectors package?

Harness, Kathleen
Hi Lawson,
This solution is from Lenny Pitt who has helped Etoyillinois a lot!
Regards,
Kathleen
________________________________________
From: Pitt, Leonard B
Sent: Saturday, September 14, 2013 4:58 PM
To: Harness, Kathleen
Subject: Re: [squeakland] how to hide ALL connectors to/from a specific node in the Connectors package?

I'm not on squeakland / Etoys mailing list, but perhaps you can pass along
the solution:

All pins should be siblings of each other.
All connectors should be siblings of each other.

Now, create a script called "hideme" for a connector, which has only the
tile "hide".
So, if a pin tells all incoming connectors to execute the script "hideme",
they will hide, and similarly, if a pin tells all outgoing connectors to
execute the script "hideme", they all will hide.

Now, to make ALL the connectors hide at once, we need to tell all pins to
tell all incoming and outgoing connectors to execute the script hideme.
To do this, create the following script:

A script for a pin called "hideeveryone" which has in it only the two
commands
  tell all incoming connectors execute script hideme.
  tell all outgoing connectors execute script hideme

Now, just have any pin send to all siblings "hideeveryone".
As a result, all pins will execute the script "hideeveryone".
Which means all will send to all their incoming and outgoing connectors
the command to execute the hideme script.

Note that this is overkill - we don't need to tell both incoming and
outgoing connectors to execute the hideme script, since every connector is
an incoming and outgoing from someone.  So the script "hideeveryone" needs
to only have one of the two lines in it.







On Sat9/14/13 Sep 14,4:04 PM, "Harness, Kathleen" <[hidden email]>
wrote:

>Hi Lenny,
>I thought you might find this note interesting:
>a fully connected graph using Etoys and the problems Lawson English is
>describing.
>
>He also has a link to an Introduction to Squeak in 68 videos that he
>posted on You Tube.
>Beyond me but I always like knowing there is more.
>Kathleen
>________________________________________
>From: [hidden email]
>[[hidden email]] on behalf of Lawson English
>[[hidden email]]
>Sent: Saturday, September 14, 2013 3:45 PM
>To: etoys dev; Squeakland List
>Subject: [squeakland] how to hide ALL connectors to/from a specific node
>in the Connectors package?
>
>I'll try again:
>
>I have 19 Connectors nodes showing in my project.
>
>There are 19 x 18 connectors -a fully connected graph.
>
>I want to be able to easily tell all connectors to hide using Etoys
>scripting. I already know how to do this with Squeak, but it isn't
>obvious at all how to make it work with etoys, despite the existence of
>a scripting option "tellAllIncomingConnections" and
>"tellAllOutgoingConnections"
>
>I can't figure it out.
>
>I've dropped down into the System browser and looked at the Smalltalk
>code for
>
>#tellAllIncomingConnections: aMessageSelector
>
>and
>
>#tellAllOutgoingConnections: aMessageSelector
>
>     "Send the given message selector to all the players of the
>receiver's costume's outgoing connections"
>
>     self costume outgoingConnections do:
>         [:m |
>             m playerRepresented ifNotNilDo:
>                 [:p | p performScriptIfCan: aMessageSelector]]
>
>I've even tried putting ^#hide into the script.
>
>
>Is this aspect of Connectors + Etoys broken or am I missing something?
>
>I can specify a SPECIFIC Connector to hide, but I have potentially 19 x
>18 or even 256 x 255 of them to work with, so obviously this isn't an
>option.
>
>Do I have to go with my incredibly cumbersome code I worked out in my
>Squeak youtube tutorials and stick that into a script, instead?
>
>
>
>
>
>Thanks.
>
>
>L
>
>
>--
>Squeak from the very start (introduction to Squeak and Pharo Smalltalk
>for the (almost) complete and compleate beginner).
>https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>
>"Debugging is twice as hard as writing the code in the first place.
>Therefore, if you write the code as cleverly as possible, you are, by
>definition, not smart enough to debug it." - Brian Kernighan
>
>_______________________________________________
>squeakland mailing list
>[hidden email]
>http://lists.squeakland.org/mailman/listinfo/squeakland
>

_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: FW: how to hide ALL connectors to/from a specific node in the Connectors package?

LawsonEnglish
Thanks for the response.

However, I assume that "tile hide" really means a tile for
"ConnectorInstance hide"

also, it doens't work. I only manage to hide the specific connector. Yes
they are all siblings.

I can't find an AllPlayers tool mentioned in the online manual. Perhaps
this is the holdup? I'm using the Mac version.


Thanks again.


Lawson

On 9/14/13 4:55 PM, Harness, Kathleen wrote:

> Hi Lawson,
> This solution is from Lenny Pitt who has helped Etoyillinois a lot!
> Regards,
> Kathleen
> ________________________________________
> From: Pitt, Leonard B
> Sent: Saturday, September 14, 2013 4:58 PM
> To: Harness, Kathleen
> Subject: Re: [squeakland] how to hide ALL connectors to/from a specific node in the Connectors package?
>
> I'm not on squeakland / Etoys mailing list, but perhaps you can pass along
> the solution:
>
> All pins should be siblings of each other.
> All connectors should be siblings of each other.
>
> Now, create a script called "hideme" for a connector, which has only the
> tile "hide".
> So, if a pin tells all incoming connectors to execute the script "hideme",
> they will hide, and similarly, if a pin tells all outgoing connectors to
> execute the script "hideme", they all will hide.
>
> Now, to make ALL the connectors hide at once, we need to tell all pins to
> tell all incoming and outgoing connectors to execute the script hideme.
> To do this, create the following script:
>
> A script for a pin called "hideeveryone" which has in it only the two
> commands
>    tell all incoming connectors execute script hideme.
>    tell all outgoing connectors execute script hideme
>
> Now, just have any pin send to all siblings "hideeveryone".
> As a result, all pins will execute the script "hideeveryone".
> Which means all will send to all their incoming and outgoing connectors
> the command to execute the hideme script.
>
> Note that this is overkill - we don't need to tell both incoming and
> outgoing connectors to execute the hideme script, since every connector is
> an incoming and outgoing from someone.  So the script "hideeveryone" needs
> to only have one of the two lines in it.
>
>
>
>
>
>
>
> On Sat9/14/13 Sep 14,4:04 PM, "Harness, Kathleen" <[hidden email]>
> wrote:
>
>> Hi Lenny,
>> I thought you might find this note interesting:
>> a fully connected graph using Etoys and the problems Lawson English is
>> describing.
>>
>> He also has a link to an Introduction to Squeak in 68 videos that he
>> posted on You Tube.
>> Beyond me but I always like knowing there is more.
>> Kathleen
>> ________________________________________
>> From: [hidden email]
>> [[hidden email]] on behalf of Lawson English
>> [[hidden email]]
>> Sent: Saturday, September 14, 2013 3:45 PM
>> To: etoys dev; Squeakland List
>> Subject: [squeakland] how to hide ALL connectors to/from a specific node
>> in the Connectors package?
>>
>> I'll try again:
>>
>> I have 19 Connectors nodes showing in my project.
>>
>> There are 19 x 18 connectors -a fully connected graph.
>>
>> I want to be able to easily tell all connectors to hide using Etoys
>> scripting. I already know how to do this with Squeak, but it isn't
>> obvious at all how to make it work with etoys, despite the existence of
>> a scripting option "tellAllIncomingConnections" and
>> "tellAllOutgoingConnections"
>>
>> I can't figure it out.
>>
>> I've dropped down into the System browser and looked at the Smalltalk
>> code for
>>
>> #tellAllIncomingConnections: aMessageSelector
>>
>> and
>>
>> #tellAllOutgoingConnections: aMessageSelector
>>
>>      "Send the given message selector to all the players of the
>> receiver's costume's outgoing connections"
>>
>>      self costume outgoingConnections do:
>>          [:m |
>>              m playerRepresented ifNotNilDo:
>>                  [:p | p performScriptIfCan: aMessageSelector]]
>>
>> I've even tried putting ^#hide into the script.
>>
>>
>> Is this aspect of Connectors + Etoys broken or am I missing something?
>>
>> I can specify a SPECIFIC Connector to hide, but I have potentially 19 x
>> 18 or even 256 x 255 of them to work with, so obviously this isn't an
>> option.
>>
>> Do I have to go with my incredibly cumbersome code I worked out in my
>> Squeak youtube tutorials and stick that into a script, instead?
>>
>>
>>
>>
>>
>> Thanks.
>>
>>
>> L
>>
>>
>> --
>> Squeak from the very start (introduction to Squeak and Pharo Smalltalk
>> for the (almost) complete and compleate beginner).
>> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>>
>> "Debugging is twice as hard as writing the code in the first place.
>> Therefore, if you write the code as cleverly as possible, you are, by
>> definition, not smart enough to debug it." - Brian Kernighan
>>
>> _______________________________________________
>> squeakland mailing list
>> [hidden email]
>> http://lists.squeakland.org/mailman/listinfo/squeakland
>>
>


--
Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner).
https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan

_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland