[sugar] [pyxpcom] PyXPCOM viability and OLPC

Marco Pesenti Gritti mpg
Wed May 9 05:03:38 EDT 2007

On Tue, 2007-05-08 at 20:50 -0400, edward baafi wrote:
> > We are locked into gtk widgets
> Is this because it's been decided that sugar shouldn't have multiple
> widget toolkits?
> Is this the case even if mozilla can be built with a gtk/cairo backend?

Yeah. We need to use gtk (and the custom gtk widgets which are provided
by Sugar) to have consistent look and feel and interaction.

> Also, if the current browser activity is written with pygtkmozembed,
> what is the meaning of: "Applications can also use xulrunner which
> includes Javascript capability." from
> http://wiki.laptop.org/go/Web_Browser

I have no idea... The information on the wiki is not always accurate.
But well you *can* use xulrunner, just the level of integration with
Sugar you can achieve using it is not satisfactory.

> > 1 Write an embedding widget from scratch in Pyxpcom. It has been done
> > for JavaXPCOM I think, so it's possible in theory.
> Is this what you're talking about:
> http://www.mozilla.org/projects/blackwood/webclient/ ?

No, see:


It embeds mozilla in an SWT widget using JavaXPCOM.

Now if we had something like that for Pyxpcom/gtk it would be awesome.
There are two things which block me about going with this approach.

1 Is pyxpcom mature enough to do it? (what's your experience with it, is
it reasonably stable and complete?)
2 Time. Writing an embedding widget from scratch, make it stable etc
does not seem like a trivial task.

> > 2 Use gtkmozembed (written in C) but give access to the gtkmozembed
> > nsIWebBrowser as a PyXPCOM object so that we can access the DOM document
> > from python. It should be possible but I never investigated it much.
> You said earlier that gtkmozembed exposes nsiWebBrowser.. Is the
> problem that this is not exposed to the python gtkmozembed wrapper?
> If that's the case, why not improve the wrapper and expose
> nsiWebBrowser as a regular python, rather than pyxpcom object?

nsIWebBrowser is just the entry point, it gives you access to the DOM
window/document for the gtkmozembed widget. We need it as pyxpcom object
so that we can access the DOM using pyxpcom (we don't want to write
regular python bindings for the whole DOM api).


More information about the Sugar-devel mailing list