Changeset 6710


Ignore:
Timestamp:
Jun 12, 2007, 12:58:02 PM (17 years ago)
Author:
Gary Byers
Message:

Generalize the print callback for simple sequence dialogs a bit more.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/examples/cocoa-utils.lisp

    r6681 r6710  
    77     (sequence :initform nil :initarg :sequence :type sequence :reader sequence-window-controller-sequence)
    88     (result-callback :initarg :result-callback)
    9      (key-transform :initform #'identity :initarg :key)
     9     (display :initform #'(lambda (item stream) (prin1 item stream)) :initarg :display)
    1010     (title :initform "Sequence dialog" :initarg :title))
    1111  (:metaclass ns:+ns-object))
     
    5959    ((self sequence-window-controller) view column (row :<NSI>nteger))
    6060  (declare (ignore column view))
    61   (with-slots (key-transform sequence) self
    62   (%make-nsstring (prin1-to-string (funcall key-transform (elt sequence row))))))
     61  (with-slots (display sequence) self
     62    (%make-nsstring (with-output-to-string (s)
     63                      (funcall display (elt sequence row) s)))))
    6364
    6465(defmethod initialize-instance :after ((self sequence-window-controller) &key &allow-other-keys)
     
    7273     +null-ptr+
    7374     nil)))
     75
     76;;; Looks like a "util" to me ...
     77(defun pathname-to-url (pathname)
     78  (make-instance 'ns:ns-url
     79                 :file-url-with-path
     80                 (%make-nsstring (native-translated-namestring pathname))))
Note: See TracChangeset for help on using the changeset viewer.