ccl 和 *.nib 文件

发布于 2024-10-07 01:47:07 字数 98 浏览 0 评论 0 原文

我是 ccl 新手,想知道如何在 *.nib 文件内的对象和 ccl 之间“通信”?我浏览了“Apple 在 Lisp 中的货币转换器”教程,但我不确定这两者是如何“通信”在一起的。

I'm new to ccl and wanted to know how to "comunicate" between objects inside a *.nib file and ccl? I walked though the "Apple's Currency Converter in Lisp" tutorial and I'm not sure how these two "communicate" together.

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

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

发布评论

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

评论(2

溺深海 2024-10-14 01:47:07

我贡献了一些教程以及大量使用 CCL 开发 Cocoa 应用程序的代码。其中包括有关如何在 CCL 中创建和使用 NIB 文件的大量讨论。它都是 CCL 发行版的一部分(获取最新代码的主干发行版)。或者您可以在 CCL 网站

I have contributed a couple of tutorials plus a substantial amount of code for developing Cocoa applications using CCL. This includes much discussion about how to create and use NIB files in CCL. It's all part of the CCL distribution (get the trunk distribution for the most current code). Or you can browse the code on the CCL website.

奈何桥上唱咆哮 2024-10-14 01:47:07

任何编程语言中的 Cocoa 在程序启动时都会自动执行很多操作:

  • 它会初始化自身。
  • 它查找主 nib 文件。
  • 它加载主 nib 文件
  • 然后运行事件循环。

加载任何 nib 文件都会执行以下操作:

  • nib 文件中的对象在内存中重新创建。
  • 您在 nib 文件中指定的各种连接也会被设置。

因此,一旦加载 nib 文件,就会有一个代表按钮的活动对象,该对象被配置为调用您在 Objective-C 或 lisp 或其他中定义的方法。因此,当您单击按钮时,事件调度程序会找到按钮,按钮然后调用您定义的方法,lisp 执行设置 UI 新状态的方法,UI 自行刷新等等。

这些概念部分并不重要。无论您使用 Objective-C、Lisp 还是 Ruby,都不会真正改变。因此,请阅读 Apple 的 Cocoa 基础知识中的此部分。同一文档的其他部分也非常好。

Cocoa in any programming language does a lot of things automatically when the program is launched:

  • It initializes itself.
  • It looks for the main nib file.
  • It loads the main nib file
  • Then it runs the event loop.

Loading of any nib file does a few things:

  • The objects in the nib file are re-created in the memory.
  • Various connections you specified in the nib file are also set up.

So, once the nib file is loaded, there is a live object representing the button, which is configured to call a method you defined in Objective-C or lisp or whatever. Therefore, when you click the button, the event dispatcher finds the button, the button then calls the method you defined, the lisp executes the method which sets the new state of the UI, the UI refreshes itself, etc.

These conceptual part doesn't really change whether you use Objective-C or Lisp or Ruby. So, please read this section in Apple's Cocoa Fundamentals. Other parts of the same document is quite good, too.

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