| Line | |
|---|
| 1 | ;; controller-test2.lisp
|
|---|
| 2 |
|
|---|
| 3 | ;; Test window that implements a class browser using an NSOutlineView to show
|
|---|
| 4 | ;; standard Lisp class objects
|
|---|
| 5 |
|
|---|
| 6 | (eval-when (:compile-toplevel :load-toplevel :execute)
|
|---|
| 7 | (require :lisp-controller)
|
|---|
| 8 | (require :ns-string-utils))
|
|---|
| 9 |
|
|---|
| 10 | (defpackage :controller-test2
|
|---|
| 11 | (:nicknames :ct2)
|
|---|
| 12 | (:use :ccl :common-lisp :iu :lc)
|
|---|
| 13 | (:export test-browser))
|
|---|
| 14 |
|
|---|
| 15 | (in-package :ct2)
|
|---|
| 16 |
|
|---|
| 17 | (defclass lisp-browser (ns:ns-window-controller)
|
|---|
| 18 | ((lisp-ctrl :foreign-type :id :accessor lisp-ctrl))
|
|---|
| 19 | (:metaclass ns:+ns-object))
|
|---|
| 20 |
|
|---|
| 21 | (objc:defmethod (#/initWithNibPath: :id)
|
|---|
| 22 | ((self lisp-browser) (nib-path :id))
|
|---|
| 23 | (let* ((init-self (#/initWithWindowNibPath:owner: self nib-path self)))
|
|---|
| 24 | init-self))
|
|---|
| 25 |
|
|---|
| 26 | (defun cl-name (cls)
|
|---|
| 27 | (symbol-name (class-name cls)))
|
|---|
| 28 |
|
|---|
| 29 | (defun cl-package (cls)
|
|---|
| 30 | (package-name (symbol-package (class-name cls))))
|
|---|
| 31 |
|
|---|
| 32 | (defun test-browser ()
|
|---|
| 33 | (let* ((nib-name (lisp-to-temp-nsstring
|
|---|
| 34 | (namestring (truename "ip:Controller Test 2;lc-test2.nib"))))
|
|---|
| 35 | (wc (make-instance 'lisp-browser
|
|---|
| 36 | :with-nib-path nib-name)))
|
|---|
| 37 | (#/window wc)
|
|---|
| 38 | wc))
|
|---|
| 39 |
|
|---|
| 40 | (provide :controller-test2)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.