用squeak写一个GUI

发布于 2024-07-15 18:22:45 字数 148 浏览 6 评论 0原文

如何在 Squeak 中编写 GIU? 我是 Smalltalk 新手,目前正在使用 Cincom 的 VisualWorks,但我想尝试一下 Squeak。 我看到 Squeak 有用于图形的 Morphic,但在我的一生中,我似乎找不到一个包来编写基于 MVC 的 GUI。

How can I write a GIU in Squeak? I'm a Smalltalk newbie and I'm using Cincom's VisualWorks at the moment but I'd like to give Squeak a try. I see that Squeak has Morphic for graphics but for the life of me I can't seem to find a package to write an MVC based GUI.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

英雄似剑 2024-07-22 18:22:45

Squeak 包含所有经典的 MVC 类,但您也可以使用 Morphic 创建 GUI,实际上比使用 MVC(轻松)创建 GUI 更有趣 - 毕竟这就是创建 Squeak 的原因!

请注意,您可能会在更具体的地方发布更好的回复 - SO 上似乎没有很多 Smalltalk 人员。 尝试http://news.gmane.org/gmane.comp.lang。从smalltalk.squeak.beginners开始。

Squeak includes all the classic MVC classes, but you can also create GUIs using Morphic, indeed much more interesting ones than you can (easily) with MVC - that is after all why Squeak was created!

Note that you may get a better response posting somewhere more specific - there don't seem to be many Smalltalk people on SO. Try http://news.gmane.org/gmane.comp.lang.smalltalk.squeak.beginners to start with.

指尖微凉心微凉 2024-07-22 18:22:45

GUI 和 Squeak 首先非常令人困惑。 使用 Squeak 创建 GUI 相当容易。 基本上,您只需绘制几个矩形,复制一些文本框,几乎每个变形的光环都允许克隆,然后您可以将这些变形放入新的 UI 中。 将您的行为添加到刚刚创建的 UI 中更加困难,因为您必须以某种方式在代码浏览器中找到您的小部件。

这就是我想指出的部分,我发现 Squeak 中的 Morphic 实现非常烦人。 所以,也许我错了这一切,但这就是我的看法。 Morphic 的设计目的是让您只需点击几下即可以图形方式构建自己的 UI。 它是在自编程环境中设计的,其中不存在浏览器对象间隙。 在 Self 中将您的克隆注册到普通代码树中是一件小事。 (导出程序当然不是一件小事,但话又说回来,在 Smalltalk 中这绝不是一件容易的事)。

因此,我遇到的现实世界形态代码通常将变形视为任何其他 UI 框架对象:从代码创建 UI,忽略图形构建。 我还没有看到像 Interface Builder 在 Mac OS X 上那样将形态 UI“冲击冻结”到文件中的便捷方法。或者,更一般地说,如果您同时单击形态 UI,则很难从代码中访问它浏览器。

Neil 的暗示将整个 Morphic 的事情放在一边并转向 MVC 可能是可以理解的。 然而,有几次我不得不在 Squeak 中处理用户界面,我检查了图像周围的 UI 生成代码,并尝试模仿它们的风格。

GUIs and Squeak are first and foremost very confusing. It is fairly easy to create a GUI using Squeak. Basically, you just draw a few rectangles, copy some text boxes, the haloes of very much every morph allow for cloning and then you can drop these morphs into your new UI. It is more difficult to add YOUR behaviour to the UI you just created since you somehow have to find your widget in the code browser.

This is the part where I would like to point out that I find the Morphic implementation in Squeak very annoying. So, maybe I've mistaken all of this, but this is how I see it. Morphic was DESIGNED to allow you to graphically construct your own UI with just a few clicks. And it was designed so in the Self programming environment, where there is no Browser-objects gap. Registering your clone into the ordinary code tree is a triviality in Self. (It is of course not trivial to export your program, but then again, in Smalltalk that is never easy anyway).

So, the real world morphic code that I come across usually treats morphs like any other UI framework objects: creating the UI from code, ignoring the graphical building. I have not seen a convenient way to "shock freeze" a morphic UI into a file the way Interface Builder does on Mac OS X. Or, more generally, if you click together a morphic UI, it is difficult to access it from the Code Browser.

The hint from Neil to leave the whole Morphic thing aside and turn to MVC might be understandable. Yet, the few times I have had to deal with user interfaces in Squeak, I examined UI generation code from around the image and tried to mimmick their style.

怼怹恏 2024-07-22 18:22:45

取决于你想做什么,你的受众是谁。 原来的 MVC 速度很快,但已经不再维护了,而且看起来很 1980 年代风格。 Self 中最初的 Morphic 可能不错,但在 Squeak 中它已经演变成意大利面条式的混乱。 看一下 Morph 继承层次结构顶部的几个类...

Pharo 为 Morphic 小部件带来更好的外观,因此新手打开图像时不会被吓跑。 此外,还有一些有前途的 GTK 和 Objective-C 绑定正在开发中,我希望看到它们得到更多的使用。 最后,我们看到越来越多的 Web 应用程序...Seaside 可以成为本机 UI 的一个很好的替代品,因为它擅长具有复杂流程的 Web 应用程序。

Depends on what you want to do, who your audience is. The original MVC is fast but is not really maintained anymore, and it looks very 1980ish. The original Morphic in Self might have been nice, but in Squeak it has evolved into a spaghetti mess. Have a look at a few classes at the top of Morph's inheritance hierarchy...

There is some effort in Pharo to bring a nicer look to the Morphic widgets, so it doesn't frighten newcomers away the second they open an image. Also there are promising GTK and Objective-C bindings under work that I'd love to see gain more use. Finally, we see more and more web apps... Seaside can be a nice alternative to native UIs, since it excels at web applications with complex flows.

地狱即天堂 2024-07-22 18:22:45

我们有一个用 Squeak 编写的现成 Windows 应用程序。 大部分都是用 Morphic 完成的。 Morphic 为主要用户体验提供了很多价值。 不过,当您使用对话框、文件选择等时,软件配置很“奇怪”。

我很高兴发现 WxSqueak 最近它提供了 Windows 的本机体验。 我将它与 Morphic 结合使用。

We have an off-the-shelf, Windows, application written in Squeak. Most of it is done with Morphic. Morphic provides alot of value for the main user experience. Software configuration though was 'weird' when you used dialog boxes, file selection, etc.

I was really happy to discover WxSqueak recently which gives a native experience from Windows. I'm using it in conjunction with Morphic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文