Changeset 7576


Ignore:
Timestamp:
Oct 31, 2007, 5:33:00 PM (12 years ago)
Author:
rme
Message:

Different kludge to deal with NSFont objects
and def-cocoa-default.

Location:
trunk/ccl/cocoa-ide
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/cocoa-ide/app-delegate.lisp

    r7575 r7576  
    1717                                  #@"FontToName")
    1818
    19   ;; These defaults are Obj-C objects, so they need to be
    20   ;; initialized here.
    21   (def-cocoa-default *editor-font* :font (#/fontWithName:size:
    22                                           ns:ns-font #@"Monaco" 10.0)
    23                      "Default font for editor windows")
    24   (def-cocoa-default *listener-input-font* :font (#/fontWithName:size:
    25                                                   ns:ns-font #@"Monaco" 10.0)
    26                      "Default font for listener input")
    27   (def-cocoa-default *listener-output-font* :font (#/fontWithName:size:
    28                                                    ns:ns-font #@"Monaco" 10.0)
    29                      "Default font for listener output")
    30 
    3119  (let* ((domain (#/standardUserDefaults ns:ns-user-defaults))
    32          (initial-values (cocoa-defaults-initial-values)))
    33     (#/registerDefaults: domain initial-values)
     20         (initial-values (cocoa-defaults-initial-values))
     21         (dict (#/mutableCopy initial-values)))
     22    (#_NSLog #@"initial-values = %@" :id initial-values)
     23    ;; The lispy def-cocoa-default macro doesn't work with
     24    ;; Objective-C objects, so initialize them here by hand.
     25    ;; This is not nice.  We have to do something better.
     26    (#/setObject:forKey: dict
     27                         (#/archivedDataWithRootObject:
     28                          ns:ns-archiver
     29                          (#/fontWithName:size: ns:ns-font #@"Monaco" 10.0))
     30                         #@"editorFont")
     31    (#/setObject:forKey: dict
     32                         (#/archivedDataWithRootObject:
     33                          ns:ns-archiver
     34                          (#/fontWithName:size: ns:ns-font #@"Monaco" 10.0))
     35                         #@"listenerInputFont")
     36    (#/setObject:forKey: dict
     37                         (#/archivedDataWithRootObject:
     38                          ns:ns-archiver
     39                          (#/fontWithName:size: ns:ns-font #@"Monaco" 10.0))
     40                         #@"listenerOutputFont")
     41    (#_NSLog #@"dict = %@" :id dict)
     42    (#/registerDefaults: domain dict)
     43    (#/release dict)
    3444    (update-cocoa-defaults)))
    3545
  • trunk/ccl/cocoa-ide/cocoa-defaults.lisp

    r7558 r7576  
    127127        (#/setObject:forKey: dict
    128128                             (case (cocoa-default-type d)
    129                                (:font (#/archivedDataWithRootObject:
    130                                        ns:ns-archiver
    131                                        value))
    132129                               (:color (#/archivedDataWithRootObject:
    133130                                        ns:ns-archiver
  • trunk/ccl/cocoa-ide/cocoa-editor.lisp

    r7575 r7576  
    1818  (defconstant large-number-for-text (float 1.0f7 +cgfloat-zero+)))
    1919
     20;;; XXX -- initialized in +[LispApplicationDelegate initialize]
     21(def-cocoa-default *editor-font* :font "foo"
     22                   "Default font for editor windows")
    2023
    2124(def-cocoa-default *editor-rows* :int 24 "Initial height of editor windows, in characters")
  • trunk/ccl/cocoa-ide/cocoa-listener.lisp

    r7575 r7576  
    66  (require "COCOA-EDITOR")
    77  (require "PTY"))
     8
     9;;; XXX -- initialized in +[LispApplicationDelegate initialize]
     10(def-cocoa-default *listener-input-font* :font "foo"
     11                   "Default font for listener input")
     12(def-cocoa-default *listener-output-font* :font "foo"
     13                   "Default font for listener output")
    814
    915(def-cocoa-default *listener-rows* :int 16 "Initial height of listener windows, in characters")
Note: See TracChangeset for help on using the changeset viewer.