webview - pyobjc webuidelegate functions not called -
i have linked webview uidelegate browserwindowcontroller in interface builder, delegate implements webuidelegate functions. in browserwindowcontroller class, do:
class browserwindowcontroller(nswindowcontroller):
webview = objc.iboutlet() def windowdidload(self): self.webview.setuidelegate_(self) def webviewdidstartload_(self, webview): print "did load start" def webview_didfailloadwitherror_(self, webview, error): print "error" def webviewdidfinishload_(self, webview): print "did finish load" def webview_shouldstartloadwithrequest_navigationtype_(self, webview, request, nav_type): print "load req"
none of lastly 4 functions, part of webuidelegate, called. tried doing (what formal protocol, though informal): class browserwindowcontroller(nswindowcontroller, webkit.protocols.webuidelegate):
but not work. have implemented webview webpolicydelegate same way , work. why doesn't webuidelegate work? have linked way have read in docs. missing informal protocol?
according apple's documentation(1) delegate protocol not have selector named webviewdidstartload:. selector is "uiwebviewdelegate" protocol, that's used on ios, not osx.
1: https://developer.apple.com/library/mac/#documentation/cocoa/reference/webkit/protocols/webuidelegate_protocol/reference/reference.html
webview pyobjc
No comments:
Post a Comment