Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top