Changeset 6789


Ignore:
Timestamp:
Jul 6, 2007, 12:01:03 PM (17 years ago)
Author:
Gary Byers
Message:

Measure char width consistently when creating text attributes.

File:
1 edited

Legend:

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

    r6762 r6789  
    175175(objc:defmethod (#/toggleTypeout: :void) ((self lisp-application) sender)
    176176  (declare (ignore sender))
    177   (#/show (#/sharedPanel typeout-panel)))
     177  (#/show (#/sharedPanel typeout-window)))
    178178
    179179(defun nslog-condition (c)
     
    287287(defun create-paragraph-style (font line-break-mode)
    288288  (let* ((p (make-instance 'ns:ns-mutable-paragraph-style))
    289          (charwidth (fround (ns:ns-size-width (#/maximumAdvancement font)))))
     289         (charwidth (fround (nth-value 1 (size-of-char-in-font font)))))
    290290    (#/setLineBreakMode: p
    291291                         (ecase line-break-mode
     
    342342  ;; Make w the "key" and frontmost window.  Make it visible, if need be.
    343343  (#/makeKeyAndOrderFront: w nil))
     344
     345(defun set-window-title (window title)
     346  (#/setTitle: window (if title
     347                        (if (typep title 'ns:ns-string)
     348                          title
     349                          (%make-nsstring title))
     350                        #@"") ))
    344351
    345352(defun new-cocoa-window (&key
     
    382389            auto-display)
    383390      (when activate (activate-window w))
    384       (when title (#/setTitle: w (%make-nsstring title)))
     391      (when title (set-window-title w title))
    385392      w)))
    386393
Note: See TracChangeset for help on using the changeset viewer.