[Cuis-dev] Turning morphs back into source code
Ian Jeffries
mail at ianjeffries.net
Wed Nov 27 17:04:56 PST 2024
Good point! That's one advantage of the specialized-GUI-builder strategy
for making and sourcifying morphs, it gets to record all the interactions.
I'm not sure how Morphic Designer
<https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/designer>
works
under the hood but they have that option. Currently I'm imaging the tool
can be pointed at any existing morph on the screen (of a type it supports),
so it needs to work by inspection not recording.
On Sun, Nov 24, 2024 at 11:44 AM Ezequiel Birman via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:
> Another strategy to address Ian's problem could be to record all the
> interactions. Emacs macros work like this.
>
> On Sun, 24 Nov 2024 at 16:16, Ezequiel Birman <ebirman77 at gmail.com> wrote:
>
>> Hm, do you have any examples? I don’t think you can build anything very
>>> useful by manipulation with the mouse without writing code… you can add
>>> submorphs to a morph, change colors and sizes, … not much more, I think…
>>> nothing like a browser or an inspector. Maybe you should checkout Fabrik,
>>> eToys, and other similar ideas.
>>
>>
>> As Luciano said, there's not much you can do by direct manipulation, yet.
>> One of the suggested ideas for helping Cuis
>> <https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/wiki/Helping-Cuis>,
>> by Juan and Hilaire is
>>
>>> Take the SVG package and turn it into and end user Vector Graphics
>>> designer application. Like a baby Inkscape
>>
>>
>> We currently lack the means to convert an arbitrary graphic entity, for
>> example a letter, into a LetterMorph composed of VectorMorphs, and/or
>> StrokeDrawnMorphs, back and forth; and that also opens the door to think
>> about morph decomposition into simpler morphs all the way down to
>> PixelMorphs, if necessary, and translations into other representations of
>> the same entity, for example into something that Dr. Geo and/or Arrows can
>> handle. Unlike with languages, these translations are easier coming from
>> one direction, and harder from the other; maybe a hint that we'd always
>> keep a good model when we need it, and derive from it, rather than the
>> other way around.
>>
>> On Sun, 24 Nov 2024 at 09:55, Luciano Notarfrancesco via Cuis-dev <
>> cuis-dev at lists.cuis.st> wrote:
>>
>>> Hm, do you have any examples? I don’t think you can build anything very
>>> useful by manipulation with the mouse without writing code… you can add
>>> submorphs to a morph, change colors and sizes, … not much more, I think…
>>> nothing like a browser or an inspector. Maybe you should checkout Fabrik,
>>> eToys, and other similar ideas.
>>>
>>> On Thu, Nov 21, 2024 at 22:27 Ian Jeffries via Cuis-dev <
>>> cuis-dev at lists.cuis.st> wrote:
>>>
>>>> Hi folks,
>>>>
>>>> I'm experimenting with turning morphs created via direct manipulation
>>>> back into source code and am looking for some tips.
>>>>
>>>> As an example use case: I'm making a world map and would like to put my
>>>> house in it. The image will be pretty simple: just three or four
>>>> rectangles for the house, a rectangle for the garage, and a few circles to
>>>> represent trees. Certainly I could just write this in code, but it seems
>>>> like more fun to use the direct manipulation features of Morphic to create
>>>> the scene (duplicate, rotate, etc), then serialize that scene to code.
>>>>
>>>> Here's the twist: I'm already familiar with Cuis-UI-Packager
>>>> <https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-UI/blob/a56d748ac25fadf3f1910f0666b7ea77bb3df286/tools/UI-Packager.pck.st> which
>>>> is very cool, but my goal here is different. I'd like the result to be
>>>> source code, not object files, ideally similar to what I would have written
>>>> by hand.
>>>>
>>>> First question: is there a term in the Smalltalk community or the
>>>> academic literature for this task? Specifically for turning runtime objects
>>>> back into idiomatic source code. (I realize this problem probably can't be
>>>> solved in the general case since it's such a hard one-- one of the reasons
>>>> I'd like to read more about it).
>>>>
>>>> Second question: there isn't already a package for this in Cuis (or
>>>> even in Pharo etc)? I wouldn't think so and can't find one by searching,
>>>> but wanted to check.
>>>>
>>>> I did find Morphic Designer
>>>> <https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/designer>
>>>> in Squeak, but that's a little different since you build the morphs in a
>>>> specialized app. I'm looking for something that you can target any
>>>> supported runtime morph with (though I don't care how small the set of
>>>> supported morphs is, any example would be helpful even if it only supported
>>>> one or two).
>>>>
>>>> I've got a little demo working for myself which has also given me some
>>>> implementation questions, but I'll save those for a later thread.
>>>>
>>>> Thanks,
>>>> Ian Jeffries
>>>> --
>>>> Cuis-dev mailing list
>>>> Cuis-dev at lists.cuis.st
>>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>>>
>>> --
>>> Cuis-dev mailing list
>>> Cuis-dev at lists.cuis.st
>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>>
>> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241127/71a8257e/attachment.htm>
More information about the Cuis-dev
mailing list