Squeak - 如何移动一个圆圈?

发布于 2024-07-25 06:58:31 字数 302 浏览 4 评论 0原文

在 Squeak Smalltalk 环境中,我正在尝试学习 Morphic。 有很多很多 Morphic 类,我无法确定最适合我当前应用程序的类,而且我不想发明任何目前已经存在的东西。 相关代码/信息的链接将不胜感激。 虽然 Pharo 可能更好,但我还是坚持使用 Squeak 自动取款机。

我的问题是:
使用 Squeak 和 Morphic,如何创建某种画布,将其放入可移动、可滚动、可调整大小的窗口中,将其显示在桌面上,将 CircleMorph 拖放到该画布上,并允许用户抓住圆圈并将其四处移动在画布上?

谢谢!

In the Squeak Smalltalk environment, I am trying to learn Morphic. There are many, many Morphic classes and I cannot determine the most appropriate one(s) to use for my current application, and I prefer not to invent anything that already exists at this point. Links to relevant code/info would be appreciated. While Pharo might be nicer, I am stuck with Squeak atm.

My question is:
Using Squeak and Morphic, how do I create some sort of canvas, drop it into a movable, scrollable, resizable window, show it on the desktop, drop a circleMorph onto that canvas, and allow the user to grab the circle and move it around on the canvas?

Thanks!

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

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

发布评论

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

评论(1

雨落□心尘 2024-08-01 06:58:31

打开工作区并键入:

| window canvas circle |
window := SystemWindow new.
canvas := PasteUpMorph new.
window addMorphBack: canvas.
canvas bounds: window bounds.
circle := CircleMorph new.
canvas addMorphCentered: circle.
window openAsIs.

这将在桌面上创建一个可以拖放的圆圈。 浏览 CircleMorph 类以查找您可以执行的其他操作。 另外,请查看 www.squeak.org 上的文档部分。 那里有很多很好的教程。

Open a workspace and type:

| window canvas circle |
window := SystemWindow new.
canvas := PasteUpMorph new.
window addMorphBack: canvas.
canvas bounds: window bounds.
circle := CircleMorph new.
canvas addMorphCentered: circle.
window openAsIs.

This will create a circle on your desktop that you can drag and drop. Browse the CircleMorph class to find other things you can do. Also, check out the Documentation section at www.squeak.org. There's a lot of good tutorials there.

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