[Openmcl-devel] hemlock, mac yosemite, and observing contentLayoutRect

Arthur Cater arthur.cater at ucd.ie
Sun Nov 1 14:22:29 PST 2015

Embarrassingly, for anyone interested,

>> But now I’ve done it I’ve run into a problem. I’d previously tinkered with Hemlock
>> in order to make a new kind of window ...
>> But when I close such a window, I get an exception that brings up the AltConsole
>> window, where it complains that it cannot remove NSScrollViewxxx as an observer
>> of the contentLayoutRect property of the NSWindow - because it isn’t an observer.
>> … Doubtless I’ve done something wrong. 

Well: I had been finding the window (a Hemlock-Frame) created behind the scenes by
(gui::find-or-make-hemlock-view nil),

and among other things setting its (slot-value … ’ns:isa) to my own objc subclass of
Hemlock-Frame. This allowed me to specialise some methods, including #/close and

The subclass had no additional slots; although I wasn’t really comfortable with changing
the ns:isa it worked fine in Snow Leopard, I couldn’t find any other way to control the
kind of window that Hemlock, I couldn’t see any reason why it wouldn’t work, and so I did it.

What I have now discovered is that changing the ns:isa back to Hemlock-Frame inside
the #/close method before using (call-next-method) makes things work again in Yosemite.
(Well, that’s how it looks now anyway.)

Is there a recommended way to make a hemlock view with a custom window class?


More information about the Openmcl-devel mailing list