Python and Bonobo
- From: David BOUCHER <bouda1 wanadoo fr>
- To: gnome-devel-list gnome org
- Subject: Python and Bonobo
- Date: Tue, 12 Oct 2004 18:44:21 +0200
Hello,
I'm playing a little with Python and bonobo. I have written a little
program that displays a GNOME_PDF_Control and three buttons called
Previous, Next and Zoom.
When I click on the zoom button, the pdf viewer is zoomed in. I would
like a click on Next button changes the view to the next page, but I
don't know how to do this. If someone could help me...
Thanks in advance.
import pygtk
import gtk
import bonobo
import bonobo.ui
def zoom_callback(button, control):
obj = control.get_objref().queryInterface("IDL:Bonobo/Zoomable:1.0")
obj.zoomIn()
win=gtk.Window()
win.connect ("delete_event", gtk.main_quit)
table = gtk.Table (2, 3)
win.add(table)
container = bonobo.ui.Container()
control = bonobo.ui.Widget("OAFIID:GNOME_PDF_Control",
container.corba_objref())
control.show()
table.attach (control, 0, 3, 0, 1)
prev = gtk.Button("Previous")
table.attach(prev, 0, 1, 1, 2)
next = gtk.Button("Next")
table.attach(next, 1, 2, 1, 2)
zoom = gtk.Button("Zoom")
table.attach(zoom, 2, 3, 1, 2)
zoom.connect("clicked", zoom_callback, control)
win.show_all()
obj = control.get_objref().queryInterface("IDL:Bonobo/PersistFile:1.0")
obj.load("file:/home/david/Maths/Divers/essai.pdf")
gtk.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]