0

I believe that I can achieve what I need using a my own custom NSWindow (i.e. my own subclass of NSWindow). Answers to Disable a WebKit WebView have told me about my NSWindow subclass but being fairly new to Cocoa, how do I get WebView to use my NSWindow subclass. The WebViews(s) are created from my .xib. I have created a custom WebView subclass (for other stuff) but WebView goes and creates it's own views/frames/windows, etc. and I cant see how to get it to use my myNSWindow (I would use a better name!).

(Basically I'm looking to intercept events, ignoring some, passing others on to the standard methods and duplicating some to other views - not as much of a UI mess as it sounds).

Community
  • 1
  • 1

1 Answers1

0

I don't understand your statement, "WebView goes and creates it's own views/frames/windows". WebView doesn't create a window -- you add the web view to a window in IB. If you have a subclass of NSWindow, you can change the class of that window in IB to that class. If you are creating your custom window in code, you can set it as the web view's window with the method setHostWindow:.

rdelmar
  • 103,982
  • 12
  • 207
  • 218
  • My WebView is inside a Custom View (NSView) in IB (inside a few other views) which is ultimately inside a Window. So is it the "top" window I change the class to use my custom NSWindow ? – Stuart Mycroft Aug 05 '12 at 21:21
  • Yes, it sounds like you only have the one window. – rdelmar Aug 05 '12 at 22:03