On Monday 14 August 2006 13:53, Artem Ananiev wrote:
Hello,

> I noticed (with Spy++) that Mozilla creates some window inside the
> provided container, but it doesn't repaint and react on any events. Then
> I found that if I call to run() method of nsIAppStartup service, the
> browser begins to dispatch all the messages, but in that case my
> application never exits even after appStartup.quit() and
> Mozilla.termEmbedding(). Do I need to run the message pump is a distinct
> thread? Is there any other way to have all the browser UI events
> dispatched?
You are right, you have to run eventloop of the widget toolkit. 

Either call AppShell.run() and then access mozilla from other 
threads over xpcomproxy.

Or spin the eventloop yourself. 
The swt/mozilla widget has this automatically thanks to swt.
An example how to implement that in Swing can be found in
WebClient (in mozilla cvs) or JRex (standalone) projects.

Note, code mozilla code strongly assumes that you access
its components on UI (main) thread. My practical experience
is that 90% of components I've ever accesed such as
windows, dom trees, css rules work on UI thread.

best regards,
Michal
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to