[squeak-dev] Re: Injecting objects into Workspace bindings

karl ramberg karlramberg at gmail.com
Thu Mar 17 19:44:25 UTC 2016


It seems though that the TransferMorphs are not very usable the way they
are created when dragged out of inspectors. They are direct links to
objects not to the instance variables. So they don't update if the instance
variable change...

Best,
Karl


On Thu, Mar 17, 2016 at 6:38 PM, karl ramberg <karlramberg at gmail.com> wrote:

> Better:
> Workspace>>acceptDroppingMorph: dropee event: evt inMorph: targetMorph
> "Return the dropee to its old position, and add a reference to it at the
> cursor point."
> | bindingName externalName reference |
> (dropee isKindOf: TransferMorph)
> ifTrue: [reference := dropee passenger.
> externalName := dropee passenger className]
> ifFalse: [reference := dropee.
> dropee externalName].
> externalName := externalName isOctetString
> ifTrue: [externalName]
> ifFalse: ['a' , externalName].
> bindingName := externalName translateToLowercase , reference identityHash
> printString.
> targetMorph correctSelectionWithString: bindingName , ' '.
> (self bindingOf: bindingName)
> value: reference.
> dropee rejectDropMorphEvent: evt.
> ^ true"success"
>
> On Thu, Mar 17, 2016 at 6:30 PM, karl ramberg <karlramberg at gmail.com>
> wrote:
>
>> A little ugly with the code duplication but it works ;-)
>>
>> Workspace>>acceptDroppingMorph: dropee event: evt inMorph: targetMorph
>> "Return the dropee to its old position, and add a reference to it at the
>> cursor point."
>> | bindingName externalName |
>> (dropee isKindOf: TransferMorph)
>> ifTrue: [externalName := dropee passenger className.
>> externalName := externalName isOctetString
>> ifTrue: [externalName]
>> ifFalse: ['a' , externalName].
>> bindingName := externalName translateToLowercase , dropee passenger
>> identityHash printString.
>> targetMorph correctSelectionWithString: bindingName , ' '.
>> (self bindingOf: bindingName)
>> value: dropee passenger]
>> ifFalse: [externalName := dropee externalName.
>> externalName := externalName isOctetString
>> ifTrue: [externalName]
>> ifFalse: ['a' , externalName].
>> bindingName := externalName translateToLowercase , dropee identityHash
>> printString.
>> targetMorph correctSelectionWithString: bindingName , ' '.
>> (self bindingOf: bindingName)
>> value: dropee].
>> dropee rejectDropMorphEvent: evt.
>> ^ true"success"
>>
>> On Thu, Mar 17, 2016 at 6:06 PM, karl ramberg <karlramberg at gmail.com>
>> wrote:
>>
>>> Workspaces are great for scripting and exploring ideas etc. And working
>>> with already existing objects. It's not so good for developing but very
>>> good for other important computing and learning needs.
>>>
>>> Best,
>>> Karl
>>>
>>>
>>> On Thu, Mar 17, 2016 at 5:55 PM, Chris Muller <ma.chris.m at gmail.com>
>>> wrote:
>>>
>>>> All Jakob had to do was "do it" on:
>>>>
>>>>   myXml := '<SomeElement>.... all kinds of XML ... </SomeElement>'
>>>>
>>>> He now has access to myXml.  Then replace all the text in the
>>>> workspace with that from the other workspace.  Done.
>>>>
>>>> I guess I see Workspaces for learning and discovery for newbies.
>>>> Short, simple, explorations of syntax and class library.
>>>>
>>>> Attempting to do work as complex as parsing a large XML is going to
>>>> present further challenges above and beyond accessing an object.  If
>>>> someone feels the need to "link workspaces" they really should stop
>>>> and consider just making a class.  In fact, I think linked workspaces
>>>> would lead a newbie down the wrong path..
>>>>
>>>> On Thu, Mar 17, 2016 at 11:28 AM, karl ramberg <karlramberg at gmail.com>
>>>> wrote:
>>>> >
>>>> >
>>>> > On Thu, Mar 17, 2016 at 4:39 PM, Chris Muller <asqueaker at gmail.com>
>>>> wrote:
>>>> >>
>>>> >> On Thu, Mar 17, 2016 at 4:58 AM, Bert Freudenberg <
>>>> bert at freudenbergs.de>
>>>> >> wrote:
>>>> >> >
>>>> >> > On 17.03.2016, at 01:43, Eliot Miranda <eliot.miranda at gmail.com>
>>>> wrote:
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > On Wed, Mar 16, 2016 at 11:58 AM, Bert Freudenberg
>>>> >> > <bert at freudenbergs.de>
>>>> >> > wrote:
>>>> >> >>
>>>> >> >>
>>>> >> >> > On 16.03.2016, at 18:48, marcel.taeumel <Marcel.Taeumel at hpi.de>
>>>> >> >> > wrote:
>>>> >> >> >
>>>> >> >> > Mabye we need a simple way to link bindings across tools. Then,
>>>> for
>>>> >> >> > example,
>>>> >> >> > we could simple connect a Workspace window to the text box in
>>>> the
>>>> >> >> > Inspector
>>>> >> >> > (resp. Object Explorer) and all would share the same bindings.
>>>> Then,
>>>> >> >> > you
>>>> >> >> > could simply select stuff in the Object Explorer, evaluate "x :=
>>>> >> >> > self"
>>>> >> >> > and
>>>> >> >> > you would have access to x in that other Workspace (resp.
>>>> Inspector's
>>>> >> >> > text
>>>> >> >> > box).
>>>> >> >>
>>>> >> >> Not a bad idea … what could be a UI for connecting workspaces?
>>>> >>
>>>> >> Why not just invoke the halos on the inspectors built-in workspace
>>>> and
>>>> >> clone it with the upper-green button and use that?
>>>> >>
>>>> > This would break workflow I think because like Jacob wrote, you open
>>>> a file
>>>> > in a Workspace and you need a reference to that from another already
>>>> open
>>>> > Workspace.
>>>> >
>>>> > How about another copy command, like 'copy as reference' and then you
>>>> could
>>>> > paste it in another Workspace ?
>>>> >
>>>> >
>>>> > Best,
>>>> > Karl
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160317/af42297e/attachment-0001.htm


More information about the Squeak-dev mailing list