Tuesday, January 20, 2009

Embedding abiword

After yesterdays bit about how really soon we'll be able to easily embed evince in any gtk app, today is abiword's turn.

This is the UI that Eben designed for the Write activity in Sugar:



And this is one of the quickest ways to embed abiword using python:


from abiword import Canvas
import gtk

w = gtk.Window()
w.show()

c = Canvas()
w.add(c)
c.show()

gtk.main()


If you are curious about what you can do programaticaly with that Canvas instance, just type pydoc abiword.Canvas.

The only distros I know where this snippet should work are Fedora 10 and 11, but there are already some beautiful souls in #sugar who are working to make sure that it will be available in the next releases of Ubuntu, Debian, Mandriva, Gentoo, OpenSUSE and others.

Update: more and better info about PyAbiword here.

3 comments:

Anonymous said...

Hi, that's look really great !

Do you know if it's possible to ask abiword to render it's content to a given cairo surface ?

Anonymous said...

With 2.6 you can't, since that does not use Cairo yet. AbiWord 2.8 will be ported to Cairo, so it should be doable there.

Jordi said...

Hi!
I'm the developer of gloobus, a file previewer (http://gloobus.wordpress.com)
I'm really interested in your job, because it fits perfect with my app!!

I would like to ask you if you want to help me :D the first thing I would like to do is to have a abiword embed widget so I can preview odt files an so on, I've seen that gnash can be also embed so it would be amazing!!

What do you think?

We can talk by mail mine is jordi.hernandezp AT gmail.com

I hope we can make the linux desktop the best ever seen!