Changeset 649


Ignore:
Timestamp:
Mar 12, 2004, 1:23:21 PM (15 years ago)
Author:
gb
Message:

use nib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-backtrace.lisp

    r640 r649  
    2828(defclass backtrace-window-controller (ns:ns-window-controller)
    2929    ((context :initarg :context :reader backtrace-controller-context)
    30      (inspector :initform nil :reader backtrace-window-controller-inspector))
     30     (inspector :initform nil :reader backtrace-controller-inspector)
     31     (outline-view :foreign-type :id :reader backtrace-controller-outline-view))
    3132  (:metaclass ns:+ns-object))
     33
     34(define-objc-method ((:id window-nib-name)
     35                     backtrace-window-controller)
     36  #@"backtrace")
    3237
    3338(defmethod our-frame-label-p ((self backtrace-window-controller) thing)
     
    3944                     backtrace-window-controller)
    4045    (declare (ignore view))
    41   (#_NSLog #@"is expandable")
    4246    (or (%null-ptr-p item)
    4347        (our-frame-label-p self item)))
     
    4751                     backtrace-window-controller)
    4852    (declare (ignore view))
    49   (#_NSLog #@"Number of children")
    50     (let* ((inspector (backtrace-window-controller-inspector self)))
     53    (let* ((inspector (backtrace-controller-inspector self)))
    5154      (cond ((%null-ptr-p item)
    5255             (inspector::inspector-line-count inspector))
     
    5861                                'inspector::stack-frame-inspector
    5962                                :frame-number (frame-label-number item)
    60                                 :object (inspector::inspector-object inspector))))))
     63                                :object (inspector::inspector-object inspector)
     64                                :update-line-count t)))))
    6165               (inspector::inspector-line-count frame-inspector)))
    6266            (t -1))))
     
    6771                     backtrace-window-controller)
    6872    (declare (ignore view))
    69   (#_NSLog #@"child of item")
    70     (let* ((inspector (backtrace-window-controller-inspector self)))
     73    (let* ((inspector (backtrace-controller-inspector self)))
    7174      (cond ((%null-ptr-p item)
    7275             (let* ((label
     
    8891                                'inspector::stack-frame-inspector
    8992                                :frame-number (frame-label-number item)
    90                                 :object (inspector::inspector-object inspector))))))
     93                                :object (inspector::inspector-object inspector)
     94                                :update-line-count t)))))
    9195               (make-objc-instance 'frame-item
    9296                                   :frame-label item
     
    110114                     backtrace-window-controller)
    111115    (declare (ignore view column))
    112   (#_NSLog #@"value for item")
    113116    (if (%null-ptr-p item)
    114117      #@"Open this"
     
    119122  (setf (slot-value self 'inspector)
    120123        (make-instance 'inspector::stack-inspector :info (backtrace-controller-context self) :update-line-count t))
    121   (let* ((w (send self 'window))
     124#|  (let* ((w (send self 'window))
    122125         (content-view (send w 'content-view)))
    123126    (slet ((frame (send content-view 'frame)))
     
    137140        (send outline-view :set-data-source self)
    138141        (send content-view :add-subview outline-view)
    139         (activate-window w)))))
     142        (activate-window w))))
     143  |#)
    140144
    141145       
     
    145149
    146150(defun backtrace-window-for-context (context)
    147   (make-instance 'backtrace-window-controller
    148                  :with-window (new-cocoa-window :title "Backtrace"
    149                                                 :activate nil)
    150                  :context context))
     151  (let* ((cont (make-instance 'backtrace-window-controller
     152                              :with-window-nib-name #@"backtrace"
     153                              :context context)))
     154    (send cont :show-window nil)
     155    cont))
     156
     157
     158
     159
     160(define-objc-method ((:void will-load)
     161                     backtrace-window-controller)
     162  (#_NSLog #@"will load %@" :address (send self 'window-nib-name)))
    151163
    152164#+notyet
Note: See TracChangeset for help on using the changeset viewer.