Re: enable print - TestGtkEmbed
- From: Doug Herbert <dougy_herbert yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: Re: enable print - TestGtkEmbed
- Date: Wed, 26 May 2004 20:56:41 -0700 (PDT)
Now next step, is how to use this new object within
the test gtk app ?
Now, I am really stuck !
so far, I have created a menu callback - source below.
The whole application falls over at the
'got window from webBrowser' print line.
Can any experts out there, see where I have gone
wrong. Has anyone else managed to print from a
embedded mozilla window - on a linux machine ?
Cheers
Doug.
void menu_print_cb (GtkMenuItem *menuitem,
TestGtkBrowser *browser)
{
nsIWebBrowser *webBrowser;
g_print("menu_print_cb\n");
gtk_moz_embed_get_nsIWebBrowser(GTK_MOZ_EMBED(browser->mozEmbed),
&webBrowser );
if (webBrowser) {
g_print("\tgot webBrowser from
browser->mozEmbed.\n");
nsCOMPtr<nsIWebBrowserPrint> browserAsPrint =
do_QueryInterface(webBrowser);
nsCOMPtr<nsIDOMWindow> window;
webBrowser->GetContentDOMWindow(getter_AddRefs(window));
if ( window) {
g_print("\tgot window from webBrowser.\n");
nsIWebProgressListener *listener;
nsCOMPtr<nsIWebProgressListener> printListener
=
do_QueryInterface(listener);
browserAsPrint->Print(0, listener );
}
else
{
g_print("\t could not get window from
webBrowser.\n");
}
} // if webBrowser
}
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]