[squeak-dev] Injecting objects into Workspace bindings

Jakob Reschke jakob.reschke at student.hpi.de
Mon Mar 14 16:54:14 UTC 2016


Fabulous! That is exactly the kind of useful but hidden functionality
I was talking about. ;-) Thank you very much!

Now the only UI annoyance left here is that dragging only works from
Inspector but not from Object Explorer, but I can live with that.

2016-03-14 17:44 GMT+01:00 Bert Freudenberg <bert at freudenbergs.de>:
> You can enable "create textual references to dropped morphs” in a workspace window’s menu (blue title bar button). Then, from the inspector, drag the field name (or ‘self’) onto the workspace. It creates a variable named like ‘transfer2694476’ pointing to the transfer morph (the thing you dragged). Access the string using 'transfer2694476 passenger’. Done.
>
> Arguably we should make workspaces know about TransferMorphs and insert a reference to the morph’s passenger automatically (and independently of the “create refs” flag).
>
> - Bert -
>
>> On 14.03.2016, at 17:15, Jakob Reschke <jakob.reschke at student.hpi.de> wrote:
>>
>> Thank you, but my question was not about how to read XML files (even
>> though I do this for the first time in Squeak). As I pointed out, I am
>> aware of the possibility to use FileStream to read the file contents
>> into a string (and then do the parsing).
>>
>> After getting the contents in a Workspace window by dragging the file
>> into the image, I hoped there were some interactive facility to bind
>> that text to a variable. In my experience, Squeak is full of useful,
>> but sometimes hidden, functionality and I silently wished more than
>> once to create such a variable from an inspected object without
>> abusing the object explorer as my surrogate Workspace.
>>
>> 2016-03-14 15:51 GMT+01:00 H. Hirzel <hannes.hirzel at gmail.com>:
>>> Hello Jakob
>>>
>>> Does this
>>> http://wiki.squeak.org/squeak/6338
>>> and this
>>> http://wiki.squeak.org/squeak/6342
>>>
>>> help for zour problem?
>>>
>>> Regards
>>> Hannes
>>>
>>> On 3/14/16, Jakob Reschke <jakob.reschke at student.hpi.de> wrote:
>>>> Hi all,
>>>>
>>>> is there a convenient way to bind some object (e. g. one that I
>>>> inspect at the moment) to a variable in a new or existing Workspace?
>>>>
>>>> Use Case: I would like to read something from an XML file and have
>>>> never done that before in Squeak. After installing the XMLParsers
>>>> stuff from SqueakMap I dragged my XML file into the image. It shows
>>>> the file content in a Workspace, great! Now I want to get that content
>>>> as a string object to later supply it to an appropriate parser. I
>>>> found the string by inspecting the morphs of the Workspace (is there
>>>> an easier way?), but now I would like to have a new workspace where I
>>>> can work with that string.
>>>>
>>>> Printing the string in the inspector and copy&pasting would be an
>>>> option, but the XML file is quite large and performance issues already
>>>> arise when I navigate around in the Workspace where the content was
>>>> loaded. For the sake of having tried it out, I attempted to print the
>>>> #fullPrintString of the string, but my VM crashed... So, is there a
>>>> way to bind arbitrary objects at hand to a Workspace, other than
>>>> copying and pasting serialized representations around or fiddling with
>>>> "global variables"?
>>>>
>>>> Of course, I could have done the file reading myself with FileStream
>>>> etc. to obtain a string, but I wondered if there is a more "tangible"
>>>> approach.
>>>>
>>>> Best regards,
>>>> Jakob
>>>>
>>>>
>>>
>>
>
>


More information about the Squeak-dev mailing list