Hi,
IMO, the nsWindow interface is being hidden for security reason.
Note that nsWindow.h is not in the mozilla/dist/ directory.
The only way to redraw is when the region is part of
your own widget. And to create your own widget, do a
search on "custom widget" in the xpfe mailing list.
(I've tried to compile and include nsWindow and BaseWidget libs
independent of mozilla and it did not seem to work.)
Steve
just my 2 cents.
Neeraj Tewari, Noida wrote:
Thanks for your help but GetMainWidget return the parent widget of
chrome window and not chrome widget pointer.
I tried following code but that seems to be very complex ..
nsCOMPtr webBrowser;
nsCOMPtr webNavigation;
nsCOMPtr docshell;
nsCOMPtr presContext;
nsCOMPtr contentWin;
nsCOMPtr doc;
nsCOMPtr ContentViewer;
nsIView *view = nsnull;
if (chrome)
{
BroPtr->chrome->GetWebBrowser(getter_AddRefs(webBrowser));
webBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
webNavigation =
do_QueryInterface(webBrowser);
docshell = do_GetInterface(webBrowser);
docshell->GetContentViewer(getter_AddRefs(ContentViewer));
if(ContentViewer)
{
nsCOMPtr
DocViewer(do_QueryInterface(ContentViewer));
if (DocViewer)
DocViewer->GetDocument(getter_AddRefs(doc));
docshell->GetPresContext
(getter_AddRefs(presContext));
if(presContext)
presContext->GetViewManager()->GetRootView (view);
view->GetWidget();
}
}
Neeraj
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Niky Williams
Sent: Wednesday, July 20, 2005 1:44 AM
To: mozilla-embedding@mozilla.org
Subject: Re: Getting nsWindow from chrome
It looks like the documentation typedefs the nsWindow as an
nsBaseWidget.
So maybe you can try something like this:
//--
---
nsIWebBrowser *piwbWebBrowser = nsnull;
nsIBaseWindow *pibwBaseWindow = nsnull;
nsWindow *pWindow = nsnull;
chrome->GetWebBrowser (&piwbWebBrowser);
piwbWebBrowser->QueryInterface (NS_GET_IID (nsIBaseWindow), (void**)
&pibwBaseWindow);
piwbWebBrowser->Release ();
piwbWebBrowser = nsnull;
pibwBaseWindow->GetMainWidget (&pWindow);
piwbBaseWindow->Release ();
piwbBaseWindow = nsnull;
//Do your GUI stuff here
pWindow->Release ();
pWindow = nsnull;
//--
---
That should work for up to at least GetMainWidget(), but I'm not sure
about
actually getting an nsWindow object from that. I hope that helps. If I
find anything else I'll reply again.
Niky Williams
"Neeraj Tewari, Noida" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi ,
Can anyone help me to get nsWindow pointer from
chrome(nsIWebBrowserChrome) pointer.As i want to redraw the chrome
region in some situation.
thanks in advance
Neeraj
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding