[Openmcl-devel] object classes and nib files

alex crain alexcrain at mail.widgetworks.com
Sun Jan 2 14:11:22 PST 2005


I'm having trouble loading an OBJC class from a nib file.

I have a class HemlockTextView that inherits NSTextView and I do

? (make-instance 'ns:ns-window-controller :with-window-nib-name 
#@"test")

[HelmockTextView awakeFromNib]

correctly finds things in the HemlockTextView slots that were assigned 
in the connections
window of Interface Builder. Furthermore, all the objc classes are 
initialized correctly,
and I can activate the resulting window.

When call DESCRIBE on the HemlockTextView objects, however, I get:

? (describe *mtv)
#<HEMLOCK-TEXT-VIEW <HemlockTextView: 0x853b2e30>
     Frame = {{0.00, 0.00}, {440.00, 288.00}}, Bounds = {{0.00, 0.00}, 
{440.00, 288.00}}
     Horizontally resizable: NO, Vertically resizable: YES
     MinSize = {440.00, 288.00}, MaxSize = {440.00, 10000000.00}
  (#x853B2E30)>
Class: #<OBJC:OBJC-CLASS HEMLOCK-TEXT-VIEW (#x1382E0)>
Wrapper: #<CCL::CLASS-WRAPPER HEMLOCK-TEXT-VIEW #x6E608DE>
Instance slots
 > Error in process Listener-2(6): #<HEMLOCK-TEXT-VIEW <HemlockTextView: 
0x853b2e30>
 >                                     Frame = {{0.00, 0.00}, {440.00, 
288.00}}, Bounds = {{0.00, 0.00}, {440.00, 288.00}}
 >                                     Horizontally resizable: NO, 
Vertically resizable: YES
 >                                     MinSize = {440.00, 288.00}, 
MaxSize = {440.00, 10000000.00}
 >                                  (#x853B2E30)> has no slots.
 > While executing: CCL::%OBJC-DOMAIN-SLOTS-VECTOR
 > Type :POP to abort.
Type :? for other options.
1 >

I'm guessing that something in the cocoa runtime code didn't like my 
slot definitions, but I don't know what.

(defclass hemlock-text-view (ns::ns-text-view)
     ((blink-location :foreign-type :unsigned :accessor 
text-view-blink-location)
      (blink-color-attribute :foreign-type :id :accessor 
text-view-blink-color)
      (blink-enabled :foreign-type :<BOOL> :accessor 
text-view-blink-enabled)
      (needs-display :initform nil :accessor text-view-needs-display)
      (master-view :foreign-type :id :accessor text-view-master-view)
      (event-queue :accessor text-view-event-queue)
      (command-thread :initform nil :accessor text-view-command-thread)
      (echo-view :foreign-type :id :accessor text-view-echo-view)
      (pane :foreign-type :id :accessor text-view-pane)
      )
   (:metaclass ns:+ns-object))

I defined all the slots as Outlets in interface builder, even though 
event-queue, command-thread and
needs-display are not :foreign-type. I'm only actually connecting 
echo-view and master-view so I'm
not actually trying to assign into those slots, though.

Clues?




More information about the Openmcl-devel mailing list