I have a button on a page that I'm displaying in a WebView with the
following code:
<input type="button" value="Print" name="PrintBtn"
onClick="window.print()">
I want to know how to intercept the print event so I can handle the
displaying of the print dialog myself. I'm actually running my own
pseudo-modal event-loop that looks something like this (note:
pseudo-code):
while(!done && (event = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:distantFuture inMode:NSDefaultRunLoopMode dequeue:YES]))
{
If([event window] == <object in my list of windows that should
receive events>)
[NSApp sendEvent:event];
Else if([event type] == NSAppKitDefined || NSSystemDefined)
[NSApp sendEvent:event];
}
The problem is, when the Print button is pressed, I never get a print
dialog. However, I can go to the application's menu and select "Print"
from there and everything works fine. I'm sure some event is getting
swallowed in my event loop, but I don't know how to figure out what it
is. When I dump out all unhandled events to the console, I'm not seeing
anything logged from the print button. Is there a delegate method that I
could intercept for this behavior? Any help would be greatly
appreciated.
Thanks,
Josh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (
Webkitsdk-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/subscriber%40opensubscriber.com
This email sent to
subscriber@open...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.