Changeset 6233


Ignore:
Timestamp:
Apr 8, 2007, 5:06:00 PM (13 years ago)
Author:
gb
Message:

Use new syntax: OBJC:DEFMETHOD, #/, MAKE-INSTANCE.

Use OBJC:LOAD-FRAMEWORK.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/addressbook.lisp

    r5864 r6233  
    11;;; This code is adapted from the webkit example and with help
    22;;; from Richard Cook and Gary Byers on the OpenMCL list.
     3;;; Things have changed since then, and it's hopefully easier
     4;;; to use add-on Cocoa frameworks than it once was.
     5;;; All this does is to try to make it possible to use AddressBook
    36
    47(in-package ccl)
     
    1619
    1720(eval-when (:compile-toplevel :load-toplevel :execute)
    18   (require "OBJC-SUPPORT")
    19   (augment-objc-interfaces :addressbook))
    20 
    21 (let* ((checked-for-addressbook nil)
    22        (addressbook-loaded nil))
    23   (defun reset-checked-for-addressbook ()
    24     (setq checked-for-addressbook nil
    25           addressbook-loaded nil))
    26   (defun check-for-addressbook ()
    27     (if checked-for-addressbook
    28       addressbook-loaded
    29       (setq checked-for-addressbook t
    30             addressbook-loaded (load-objc-extension-framework "AddressBook")))))
    31 
    32 (defun require-addressbook ()
    33   (or (check-for-addressbook)
    34       (error "The AddressBook framework doesn't seem to be installed on this machine.")))
     21  (require "OBJC-SUPPORT"))
    3522
    3623(eval-when (:compile-toplevel :load-toplevel :execute)
    37   (require-addressbook))
     24  (objc:load-framework "AddressBook" :addressbook))
     25
     26;;; Now, someone should write some code which tries to
     27;;; actually -use- AddessBook, perhaps via Bosco.  It's
     28;;; probably easier to experiment with AddressBook if
     29;;; the demo IDE is loaded.
     30
Note: See TracChangeset for help on using the changeset viewer.