On 2012-12-13, at 07:59, commits@source.squeak.org 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]
targetMorph correctSelectionWithString: externalName. dropee rejectDropMorphEvent: evt. ^ true "success"ifFalse:[^dropee rejectDropMorphEvent: evt. ] ifTrue:[externalName := dropee actualObject uniqueNameForReference]] ifFalse:[externalName := dropee assuredPlayer uniqueNameForReference].
!
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 -
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 bert@freudenbergs.dewrote:
On 2012-12-13, at 07:59, commits@source.squeak.org 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 etoys-dev@squeakland.org http://lists.squeakland.org/mailman/listinfo/etoys-dev
On 14.12.2012, at 06:14, Steve Thomas sthomas1@gosargon.com 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 -
On Fri, Dec 14, 2012 at 11:52 AM, Bert Freudenberg bert@freudenbergs.dewrote:
On 14.12.2012, at 06:14, Steve Thomas sthomas1@gosargon.com 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 etoys-dev@squeakland.org http://lists.squeakland.org/mailman/listinfo/etoys-dev
On Thu, Dec 13, 2012 at 4:05 PM, Bert Freudenberg bert@freudenbergs.dewrote:
On 2012-12-13, at 07:59, commits@source.squeak.org 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 etoys-dev@squeakland.org http://lists.squeakland.org/mailman/listinfo/etoys-dev
etoys-dev@lists.squeakfoundation.org