Changeset 6153


Ignore:
Timestamp:
Apr 7, 2007, 12:45:10 PM (12 years ago)
Author:
gb
Message:

Use ns:with-... instead of rlet/ns:init.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/objc-gf/ccl/examples/cocoa-prefs.lisp

    r6130 r6153  
    5757  (let* ((scrollview (prefs-view-scroll-view self))
    5858         (contentsize (#/contentSize scrollview)))
    59     (rlet ((form-frame :ns-rect)
    60            (intercell-spacing-size :ns-size)
    61            (cell-size :ns-size))
    62       (ns:init-ns-rect form-frame 0 0 (ns:ns-size-width contentsize) (ns:ns-size-height contentsize))
    63       (ns:init-ns-size intercell-spacing-size 1 4)
    64       (ns:init-ns-size cell-size 500 22)
    65       (let* ((form (make-instance 'ns:ns-form :with-frame form-frame)))
    66         (#/setScrollable: form t)
    67         (#/setIntercellSpacing: form intercell-spacing-size)
    68         (#/setCellSize: form cell-size)
    69         (setf (prefs-view-form self) form)
    70         (#/setDocumentView: scrollview form)
    71         form))))
     59    (ns:with-ns-rect (form-frame 0 0 (ns:ns-size-width contentsize) (ns:ns-size-height contentsize))
     60      (ns:with-ns-size (intercell-spacing-size 1 4)
     61        (ns:with-ns-size (cell-size 500 22)
     62          (let* ((form (make-instance 'ns:ns-form :with-frame form-frame)))
     63            (#/setScrollable: form t)
     64            (#/setIntercellSpacing: form intercell-spacing-size)
     65            (#/setCellSize: form cell-size)
     66            (setf (prefs-view-form self) form)
     67            (#/setDocumentView: scrollview form)
     68            form))))))
    7269
    7370(defmethod init-prefs-form-from-defaults ((self prefs-view))
     
    144141(objc:defmethod #/initWithFrame: ((self prefs-view) (frame :<NSR>ect))
    145142  (call-next-method frame)
    146   (rlet ((scroll-frame :ns-rect))
    147     (ns:init-ns-rect scroll-frame 20 40 (- (ns:ns-rect-width frame) 40) (- (ns:ns-rect-height frame) 60))
     143  (ns:with-ns-rect (scroll-frame 20 40 (- (ns:ns-rect-width frame) 40) (- (ns:ns-rect-height frame) 60))
    148144    (let* ((scrollview (make-instance 'ns:ns-scroll-view
    149145                                      :with-frame scroll-frame))
     
    158154      (#/setAutoresizesSubviews: scroll-content t)
    159155      (setf (slot-value self 'scroll-view) scrollview)
    160       (rlet ((revert-frame :ns-rect)
    161              (commit-frame :ns-rect))
    162         (ns:init-ns-rect revert-frame 20 10 80 20)
    163         (ns:init-ns-rect commit-frame (- (+ (ns:ns-rect-x frame)
    164                                              (ns:ns-rect-width frame))
    165                                           (+ 80.0f0 20.0f0)) 10 70 20)
     156      (ns:with-ns-rect (revert-frame 20 10 80 20)
     157        (ns:with-ns-rect (commit-frame (- (+ (ns:ns-rect-x frame)
     158                                             (ns:ns-rect-width frame)
     159                                             (+ 80.0f0 20.0f0)))
     160                                       10 80 20)
    166161        (let* ((commit-button (make-instance
    167162                               'ns:ns-button
     
    187182          (#/addSubview: self commit-button)
    188183          (#/addSubview: self scrollview)
    189           self)))))
     184          self))))))
    190185
    191186(defloadvar *preferences-panel* nil)
Note: See TracChangeset for help on using the changeset viewer.