Morphic 中的 Morph 和 Cocoa 中的 NSView 有什么区别?
我想了解 Morphic 的独特之处。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想了解 Morphic 的独特之处。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Morphic 远比 NSView 或任何其他图形类简单地允许重新实现一组有限的功能要重要得多。 Morphic 是一个可塑性极强的 UI 构建工具包。 Morphic 背后的一些设计思想明确了这一意图:
#drawOn:
方法及其子变形的位置都在它自己的坐标系中表示。Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic is an extremely malleable UI construction kit. Some design ideas behind Morphic makes this intention clear:
#drawOn:
method and the location of its sub-morphs are expressed in its own coordinate system.警告:Smalltalk 的实时动态环境是一个红色药丸。静态、冻结的语言对您来说永远不会一样;-)
简而言之:Morphic 是一个虚拟世界,您可以在其中直接探索活动对象(只需就像现实世界一样)。您是否曾经在查看用户界面时......
虽然这些想法在任何其他环境中都会导致痛苦和沮丧,但在 Morphic 中却并非如此。
如果您想大吃一惊,成为 Morphic 世界中的神:
启动 Pharo 图像,然后单击背景(实际上是“世界”)以调出世界菜单:
在菜单选项之一上调出“光环” (在我的 Mac 上按住 Shift+Alt+单击):
拖动“拾取”光环(中上)并将其放在世界的某个地方:
享受您的菜单项,现在您可以在任何您想要的地方使用它:
说真的,单击它并观看浏览器打开!
您是否曾经有过一个总是使用的选项,供应商已经深埋了三级菜单?这能有用吗?!这是像 Morphic 这样的实时直接 GUI 环境的强大功能的一瞥。
如果您感兴趣,请阅读约翰·马洛尼和约翰·马洛尼的著作。兰德尔·史密斯 (Randall Smith) 的论文 直接性和形态用户界面构建环境中的活跃度< /a>
Warning: Smalltalk's live dynamic environment is a red pill. 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). Did you ever look at a UI and...
While these thoughts would lead to pain and frustration in any other environment, not so in 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:
Bring up the "halos" on one of the menu options (shift-alt-click on my Mac):
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.
If you're intrigued, read John Maloney & Randall Smith's paper Directness and Liveness in the Morphic User Interface Construction Environment
标题没有反映您的问题,因此我回答您的问题而不是标题。
过去两天我阅读了有关 Morphic 的内容,并以我认为 Morphic 的特殊之处作为结束语。
Morphic 非常适合实时编码。这是一种直接映射,当代码更改时,屏幕上的输出也会更改。和/或如果屏幕上的变形发生更改(拖动),则代码中的值也会发生更改。这在艺术表演中真是太酷了!
但 Morphic 的目标是更高的抽象。变形的属性是从代码中抽象出来的。对文件或 SoC 执行操作mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" rel="nofollow noreferrer">获取服务器端数据库。
我认为 WebStorage 和 JavaScript 文件是存储交互更改的 Morph 属性的活跃状态的不错选择。你看,编程是通过每个 Morph 完成的。然后代码只需要处理来自单击和拖动的事件。
研究的目标甚至已经将代码抽象化了。可以通过变形来完成编码,以定义单击或拖动时发生的情况。变形可以像 Scratch 中的拼图一样。
程序必须备份到某个地方的文件中。我认为在云上进行编码并不安全。因此 JS 文件是唯一的选择(如果不设置服务器是一个选项),因为本地不允许数据文件,甚至不允许与 Web 应用程序位于同一文件夹中。同源策略意味着同一服务器 - 不是同一文件夹。
当应用启动 Javascript 文件(或 Web Storage 时第一名)将建立变形世界。用户与那个世界互动。新状态可以存储在 WebStorage 中并通过下载进行备份。
您可以使用 Lively Kernel 作为文件中的语言或存储变形对象中的数据或任何您认为最容易生成为要下载的文件的数据。
那么这有什么特别之处呢?我不会重复已接受的答案,但这是我的结论:
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 is perfect for live coding. 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. The properties of the morphs is abstracted away from the code. Do the SoC to a file or fetch a server-side database.
I suppose WebStorage and JavaScript file is a good option to store the liveness state of the Morph properties changed interactively. You see - programming is done through each 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.
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. 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. User interacts with that world. The new state can be stored in WebStorage and bacuped by a download.
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.
So what is special with this? I am not repeat the accepted answer, but this is my conclusion: