gtk - Simple "Hello-World" program for python-evince -
I try to write a simple "hello-world" type program using the Python-Avance package for intuitive links I am doing Gnome, which embeds avance in a python-gtk window, the samples I get on the web come in this way:
import import imports gtk w = gtk.Window () .show () e = evince.View () w.add (e) e Show () document = evince.document_factory_get_document ('my pdf file') e.set_document (document) gtk.main ()
The problem is that "evince.set_document" no longer exists : The forums indicate that the recent changes are due, but I am unable to understand the necessary (possibly very simple) amendments to do this work. Can anyone help?
The API has changed, has been added with additional steps. These instructions should help:
& gt; & Gt; & Gt; E = evince.View ()> & gt; & Gt; & Gt; Docmodel = evince.DocumentModel () & gt; & Gt; & Gt; Doc = evince.document_factory_get_document ('file: ///path/to/file/example.pdf') & gt; & Gt; & Gt; Docmodel.set_document (doctor) & gt; & Gt; & Gt; E.set_model (model)
Comments
Post a Comment