Re: Python and Bonobo



  I think you need to create a bonobo.ui.Window (instead of gtk.Window)
and put your control in it.  This way, you'll get the control's UI
elements merged in your main window, including the Next button.

  Perhaps the example in gnome-python/examples/bonobo/bonoboui will
help...

Ter, 2004-10-12 às 18:44 +0200, David BOUCHER escreveu:
> 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()
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
The universe is always one step beyond logic.

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]