[英]What is the difference between a Morph in Morphic and a NSView in Cocoa?
我想知道使Morphic特别的事物。
Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic远远超过了NSView或任何其他仅允许重新实现一组有限功能的图形类。 Morphic is an extremely malleable UI construction kit. Morphic是一个非常具有延展性的UI构造工具包。 Some design ideas behind Morphic makes this intention clear: Morphic背后的一些设计思想清楚地表明了这一意图:
#drawOn:
method and the location of its sub-morphs are expressed in its own coordinate system. 它的#drawOn:
方法及其子变形的位置在其自己的坐标系中表示。 Warning: Smalltalk's live dynamic environment is a red pill . 警告:Smalltalk的动态环境是一个红色药丸 。 Static, frozen languages will never be the same for you ;-) 静态的冻结语言对您而言永远不会相同;-)
In a nutshell: Morphic is a virtual world where you can directly explore live objects (just like the real world). 简而言之:Morphic是一个虚拟世界 ,您可以在其中直接探索活动对象 (就像现实世界一样)。 Did you ever look at a UI and... 您是否曾经看过UI并...
While these thoughts would lead to pain and frustration in any other environment, not so in Morphic. 尽管这些想法会在其他任何环境中导致痛苦和沮丧,但在Morphic中却不会。
If you want to blow your mind, become a god in a Morphic world: 如果您想打定主意,请在变身世界中成为神:
Launch a Pharo image, and click on the background (which is actually the "World") to bring up the world menu: 启动Pharo图像,然后单击背景(实际上是“世界”)以调出世界菜单:
Bring up the "halos" on one of the menu options (shift-alt-click on my Mac): 在菜单选项之一上调出“晕轮”(在Mac上按住Shift键并单击鼠标):
Drag the "Pick Up" halo (top-middle) and drop it somewhere in the world: 拖动“拾取”光晕(中上)并将其拖放到世界上的某个位置:
Enjoy your menu item which is now available wherever you want it: 享受你需要的地方现在是可用的菜单项:
Seriously, click it and watch the Browser open!! 认真地,单击它并观看浏览器打开!
Ever have an option you always use that a vendor has buried three-menu-levels deep? 曾经有你总是使用一个厂商都埋三菜单层次深的选项? Could this be useful?! 这有用吗? This is a glimpse of the power of a live direct GUI environment like Morphic. 这是对实时直接GUI环境(如Morphic)的强大功能的一瞥。
If you're intrigued, read John Maloney & Randall Smith's paper Directness and Liveness in the Morphic User Interface Construction Environment 如果您感兴趣,请阅读John Maloney和Randall Smith的论文《形态用户界面构建环境中的直接性和生动性》。
The title do not map your question, so I answer your question and not the title. 标题不代表您的问题,所以我回答您的问题,而不是标题。
I have read about Morphic the last two days and conclude with what I think makes morphic special. 最近两天,我已经阅读了有关Morphic的内容,并以我认为使morphic特殊的内容作为结论。
Morphic is perfect for live coding . Morphic非常适合实时编码 。 That is a direct mapping such that when code is changed the output on the screen change. 这是一种直接映射,因此当更改代码时,屏幕上的输出也会更改。 And/or if morphs on screen is changed (draged) the values in the code is changed. 和/或如果更改了屏幕上的变形,则代码中的值也会更改。 That is cool in art performance! 艺术表演太酷了!
But Morphic aims for higher abstractions than that. 但是Morphic的目标是实现更高的抽象度。 The properties of the morphs is abstracted away from the code. 从代码中抽象出了morph的属性。 Do the SoC to a file or fetch a server-side database. 将SoC写入文件或获取服务器端数据库。
I suppose WebStorage and JavaScript file is a good option to store the liveness state of the Morph properties changed interactively. 我想WebStorage和JavaScript文件是存储交互更改的Morph属性的活动状态的好选择。 You see - programming is done through each Morph. 您会看到-编程是通过每个Morph完成的。 Then the code need only to handle events from click and drag. 然后,该代码仅需要处理单击和拖动中的事件。
The aim for research has even abstracted the code away. 研究的目的甚至将代码抽象掉了。 Coding can be done through the Morph to define what happen with click or drag. 可以通过“变形”进行编码,以定义单击或拖动时发生的情况。 Morphs can be puzzle pieces as in Scratch . 变形可以像Scratch一样是拼图。
A program has to be backed up into a file somewhere. 必须将程序备份到某个位置的文件中。 I don't consider to do coding on a cloud as safe. 我不认为在云上进行编码是安全的。 So a JS-file is the only alternative (if not setting up a server is an option), because datafiles is not allowed locally, not even in same folder as the web app. 因此,JS文件是唯一的选择(如果不设置服务器,则是一个选择),因为数据文件不允许在本地使用,甚至不能与Web应用程序位于同一文件夹中。 The Same Origin policy means same server - not same folder. “相同来源”策略表示相同的服务器-不是相同的文件夹。
When the app starts the Javascript file (or Web Storage in first place) will set up the world of morphs. 当应用启动时,JavaScript文件(或首先放在Web存储中)将建立变形世界。 User interacts with that world. 用户与那个世界互动。 The new state can be stored in WebStorage and bacuped by a download. 新状态可以存储在WebStorage中并通过下载进行处理。
You can use Lively Kernel as the language in the file or store the morph data in an object or whatever you find simplest to generate as a file to download. 您可以将Lively Kernel用作文件中的语言,或者将变形数据存储在对象中,或者将您发现最简单的任何形式生成为要下载的文件。
So what is special with this? 那么这有什么特别的呢? I am not repeat the accepted answer, but this is my conclusion: 我不会重复已接受的答案,但这是我的结论:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.