Etoys: Tools-kfr.14.mcz

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

Etoys: Tools-kfr.14.mcz

commits-2
Karl Ramberg uploaded a new version of Tools to project Etoys:
http://source.squeak.org/etoys/Tools-kfr.14.mcz

==================== Summary ====================

Name: Tools-kfr.14
Author: kfr
Time: 13 December 2012, 8:59:15 am
UUID: ca9017f6-5c84-284c-a508-fbabbe39c1dd
Ancestors: Tools-kfr.13

A little better conversion of tiles to code

=============== Diff against Tools-kfr.13 ===============

Item was changed:
  ----- Method: MethodHolder>>acceptDroppingMorph:event:inMorph: (in category 'drag and drop') -----
  acceptDroppingMorph: dropee event: evt inMorph: targetMorph
  "Return the dropee to its old position, and add a reference to it at the cursor point."
  | externalName |
  (dropee isTileLike)
  ifTrue:[dropee isTileMorph
+ ifFalse:[ externalName := dropee codeString unparenthetically]
- ifFalse:[^dropee rejectDropMorphEvent: evt. ]
  ifTrue:[externalName := dropee actualObject uniqueNameForReference]]
  ifFalse:[externalName := dropee assuredPlayer uniqueNameForReference].
  targetMorph correctSelectionWithString: externalName.
  dropee rejectDropMorphEvent: evt.
  ^ true "success"
  !

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

Re: Etoys: Tools-kfr.14.mcz

Bert Freudenberg

On 2012-12-13, at 07:59, [hidden email] wrote:

> Karl Ramberg uploaded a new version of Tools to project Etoys:
> http://source.squeak.org/etoys/Tools-kfr.14.mcz
>
> ==================== Summary ====================
>
> Name: Tools-kfr.14
> Author: kfr
> Time: 13 December 2012, 8:59:15 am
> UUID: ca9017f6-5c84-284c-a508-fbabbe39c1dd
> Ancestors: Tools-kfr.13
>
> A little better conversion of tiles to code
>
> =============== Diff against Tools-kfr.13 ===============
>
> Item was changed:
>  ----- Method: MethodHolder>>acceptDroppingMorph:event:inMorph: (in category 'drag and drop') -----
>  acceptDroppingMorph: dropee event: evt inMorph: targetMorph
>   "Return the dropee to its old position, and add a reference to it at the cursor point."
>   | externalName |
>   (dropee isTileLike)
>   ifTrue:[dropee isTileMorph
> + ifFalse:[ externalName := dropee codeString unparenthetically]
> - ifFalse:[^dropee rejectDropMorphEvent: evt. ]
>   ifTrue:[externalName := dropee actualObject uniqueNameForReference]]
>   ifFalse:[externalName := dropee assuredPlayer uniqueNameForReference].
>   targetMorph correctSelectionWithString: externalName.
>   dropee rejectDropMorphEvent: evt.
>   ^ true "success"
>  !


It's a bit misleading that you call the temp var "externalName" because the #externalName message returns the user-visible name of a player, not the unique name for reference. They are sometimes the same, but sometimes not. "referenceName" would be better.

- Bert -


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

Re: Etoys: Tools-kfr.14.mcz

Steve Thomas
Karl,

Thanks, so just to ensure my understanding, this is basically allows me to drop a "tile representing an object" into a textual script and the referencenName (as opposed to the externalName, which is what the user sees when you get the halo) is inserted for use in the textual script.  This is needed because the externalName is not necessarily unique and can't be referenced directly by just using that name in a script.

So this is good and useful.

Now don't shoot me for asking (and please don't do what I am asking, there are far more important things I am sure), but...

Wouldn't it be simpler and less confusing for the user if the externalName was the referenceName?  
Of course by simpler, I am only referring to the User's viewpoint, not that of the programmer :D

Cheers,
Stephen

On Thu, Dec 13, 2012 at 10:05 AM, Bert Freudenberg <[hidden email]> wrote:

On 2012-12-13, at 07:59, [hidden email] wrote:

> Karl Ramberg uploaded a new version of Tools to project Etoys:
> http://source.squeak.org/etoys/Tools-kfr.14.mcz
>
> ==================== Summary ====================
>
> Name: Tools-kfr.14
> Author: kfr
> Time: 13 December 2012, 8:59:15 am
> UUID: ca9017f6-5c84-284c-a508-fbabbe39c1dd
> Ancestors: Tools-kfr.13
>
> A little better conversion of tiles to code
>
> =============== Diff against Tools-kfr.13 ===============
>
> Item was changed:
>  ----- Method: MethodHolder>>acceptDroppingMorph:event:inMorph: (in category 'drag and drop') -----
>  acceptDroppingMorph: dropee event: evt inMorph: targetMorph
>       "Return the dropee to its old position, and add a reference to it at the cursor point."
>       | externalName |
>       (dropee isTileLike)
>                               ifTrue:[dropee isTileMorph
> +                                                     ifFalse:[ externalName := dropee codeString unparenthetically]
> -                                                     ifFalse:[^dropee rejectDropMorphEvent: evt. ]
>                                                       ifTrue:[externalName := dropee actualObject uniqueNameForReference]]
>                               ifFalse:[externalName := dropee assuredPlayer uniqueNameForReference].
>       targetMorph correctSelectionWithString: externalName.
>       dropee rejectDropMorphEvent: evt.
>       ^ true "success"
>  !


It's a bit misleading that you call the temp var "externalName" because the #externalName message returns the user-visible name of a player, not the unique name for reference. They are sometimes the same, but sometimes not. "referenceName" would be better.

- Bert -


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


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

Re: Etoys: Tools-kfr.14.mcz

Karl Ramberg
In reply to this post by Bert Freudenberg


On Thu, Dec 13, 2012 at 4:05 PM, Bert Freudenberg <[hidden email]> wrote:

On 2012-12-13, at 07:59, [hidden email] wrote:

> Karl Ramberg uploaded a new version of Tools to project Etoys:
> http://source.squeak.org/etoys/Tools-kfr.14.mcz
>
> ==================== Summary ====================
>
> Name: Tools-kfr.14
> Author: kfr
> Time: 13 December 2012, 8:59:15 am
> UUID: ca9017f6-5c84-284c-a508-fbabbe39c1dd
> Ancestors: Tools-kfr.13
>
> A little better conversion of tiles to code
>
> =============== Diff against Tools-kfr.13 ===============
>
> Item was changed:
>  ----- Method: MethodHolder>>acceptDroppingMorph:event:inMorph: (in category 'drag and drop') -----
>  acceptDroppingMorph: dropee event: evt inMorph: targetMorph
>       "Return the dropee to its old position, and add a reference to it at the cursor point."
>       | externalName |
>       (dropee isTileLike)
>                               ifTrue:[dropee isTileMorph
> +                                                     ifFalse:[ externalName := dropee codeString unparenthetically]
> -                                                     ifFalse:[^dropee rejectDropMorphEvent: evt. ]
>                                                       ifTrue:[externalName := dropee actualObject uniqueNameForReference]]
>                               ifFalse:[externalName := dropee assuredPlayer uniqueNameForReference].
>       targetMorph correctSelectionWithString: externalName.
>       dropee rejectDropMorphEvent: evt.
>       ^ true "success"
>  !


It's a bit misleading that you call the temp var "externalName" because the #externalName message returns the user-visible name of a player, not the unique name for reference. They are sometimes the same, but sometimes not. "referenceName" would be better.
 
Thanks for the plug.
Copy-paste of code without reflection from my side caused this error.
I'll fix it
 
Karl

- Bert -

 

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


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

Re: Etoys: Tools-kfr.14.mcz

Bert Freudenberg
In reply to this post by Steve Thomas
On 14.12.2012, at 06:14, Steve Thomas <[hidden email]> wrote:

> Karl,
>
> Thanks, so just to ensure my understanding, this is basically allows me to drop a "tile representing an object" into a textual script and the referencenName (as opposed to the externalName, which is what the user sees when you get the halo) is inserted for use in the textual script.  This is needed because the externalName is not necessarily unique and can't be referenced directly by just using that name in a script.
>
> So this is good and useful.
>
> Now don't shoot me for asking (and please don't do what I am asking, there are far more important things I am sure), but...
>
> Wouldn't it be simpler and less confusing for the user if the externalName was the referenceName?  

It would, and it normally is. But if the user renames an object, then Etoys can automatically adjust the tiles, but it won't touch the textual code. Also, sometimes you cannot use the Etoys name because there would be a name clash. E.g. "Rectangle" is a perfectly valid Etoys name, but it also is a Squeak class name. In a textual script, "Rectangle" really needs to refer to the class. Hence, the reference name would become "Rectangle1" or something similar.

- Bert -


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

Re: Etoys: Tools-kfr.14.mcz

Karl Ramberg


On Fri, Dec 14, 2012 at 11:52 AM, Bert Freudenberg <[hidden email]> wrote:
On 14.12.2012, at 06:14, Steve Thomas <[hidden email]> wrote:

> Karl,
>
> Thanks, so just to ensure my understanding, this is basically allows me to drop a "tile representing an object" into a textual script and the referencenName (as opposed to the externalName, which is what the user sees when you get the halo) is inserted for use in the textual script.  This is needed because the externalName is not necessarily unique and can't be referenced directly by just using that name in a script.
>
> So this is good and useful.
>
> Now don't shoot me for asking (and please don't do what I am asking, there are far more important things I am sure), but...
>
> Wouldn't it be simpler and less confusing for the user if the externalName was the referenceName?

It would, and it normally is. But if the user renames an object, then Etoys can automatically adjust the tiles, but it won't touch the textual code. Also, sometimes you cannot use the Etoys name because there would be a name clash. E.g. "Rectangle" is a perfectly valid Etoys name, but it also is a Squeak class name. In a textual script, "Rectangle" really needs to refer to the class. Hence, the reference name would become "Rectangle1" or something similar.

- Bert -


Also, it's the player we script, not the morph, so there is some magic happening that is covered up.
 
Karl
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev


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

Re: Etoys: Tools-kfr.14.mcz

Steve Thomas
In reply to this post by Steve Thomas
On Fri, Dec 14, 2012 at 4:06 AM, karl ramberg <[hidden email]> wrote:


On Fri, Dec 14, 2012 at 6:14 AM, Steve Thomas <[hidden email]> wrote:
Karl,

Thanks, so just to ensure my understanding, this is basically allows me to drop a "tile representing an object" into a textual script and the referencenName (as opposed to the externalName, which is what the user sees when you get the halo) is inserted for use in the textual script.  This is needed because the externalName is not necessarily unique and can't be referenced directly by just using that name in a script.

So this is good and useful.
 
Textual scripts are way more useful by this addition :-)
 
You can drop any morph or "tile representing an object" and it should insert it's unique reference name.
 
You can also drop any PhraseTile and it should expand to it's code string.
Just tried it, way cool.
 
(I does not handle correct identification of phrases from other players yet, so all phrases expand to 'self ...' etc. ( I'll look at this issue. It should not be hard to implent)
That would be nice too.  Thanks. 

 

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