Search code examples
macoscocoawebviewnsfontmanagernscolorpanel

WebView as responder


I would like to receive the changeFont: and changeColor: messages in a WebView subclass.

According to the documentation, these methods are sent by NSFontManager and NSColorPanel respectively to responders.

Yet, they never get called in my WebView subclass. Is this the expected behavior? If not, what am I doing wrong?


Solution

  • Apparently because the WebView had editable content the events were being consumed by a child responder.

    The workaround was to listen to WebViewDidChangeNotification when this happens.