Changeset 378


Ignore:
Timestamp:
Jan 24, 2004, 3:33:39 PM (21 years ago)
Author:
Gary Byers
Message:

Preliminary NSBox stuff. Not much of it, even.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/hemlock-textstorage.lisp

    r6 r378  
    354354        tv))))
    355355
     356(defun put-textview-in-box (box)
     357  (slet ((r (send (send box 'content-view) 'bounds)))
     358    (let* ((sv (make-objc-instance 'ns-scroll-view :with-frame r))
     359           (sv-content-view (send sv 'content-view)))
     360      (declare (ignorable sv-content-view))
     361      (send box :set-content-view sv)
     362      (slet ((sv-content-size (send sv 'content-size)))
     363        (slet ((tv-frame (ns-make-rect 0.0f0 0.0f0
     364                                       (pref sv-content-size :<NSS>ize.width)
     365                                       (pref sv-content-size :<NSS>ize.height))))
     366          (let* ((tv (make-objc-instance 'ns-text-view
     367                                         :with-frame tv-frame)))
     368            (send sv :set-document-view tv)
     369            (send box :set-content-view sv)
     370            (values tv sv)))))))
     371
    356372(defun read-file-to-hemlock-buffer (path)
    357373  (let* ((buffer (hemlock::find-file-buffer path)))
Note: See TracChangeset for help on using the changeset viewer.