Synaptic : Libglade for Python

ZIYAD A. M. AL-BATLY zamb at saudi.net.sa
Sun Apr 9 09:28:27 UTC 2006


On Sun, 2006-04-09 at 13:54 +0700, LinuxMurah.com wrote:
> here is my complete program taken from http://baypiggies.net/old/10mintig.html
> 
> #!/usr/bin/python
> 
> from gtk import *
> from gnome.ui import *
> from GDK import *
> import libglade
> 
> def main():
>  widgets = libglade.GladeXML('foo.glade')
> 
>  app1 = widgets.get_widget('app1')
> 
>  label1 = widgets.get_widget('label1')
>  label2 = widgets.get_widget('label2')
>  label3 = widgets.get_widget('label3')
> 
>  label1.set_text('New Label Text for Label 1');
>  label2.set_text('New Label Text for Label 2');
>  label3.set_text('New Label Text for Label 3');
>  app1.set_title('This is a new application window title');
> 
>  mainloop()
> 
> if __name__ == '__main__':
>  main()
> 
> when I run it in Ubuntu always error, so how I can change it so that
> it can be run in Breezy? I have already 'glade-2' and 'python-glade2'
> installed.
> 
That's an old script that uses the *old* libraries (i.e. older than GTK+
2.0 and GNOME 2.0).

Just install the packages:
        python-glade-1.2
        python-gdk-imlib-1.2
        python-gnome-1.2

and hopefully you would be set.

(If you're in the process of learning PyGTK I advice you to learn the
new version instead of the old one.  In other words: GTK+ >=2.0, GNOME
>=2.0, glade >=2.0, as they provide much better options/functionality.
Here's a linkĀ¹ that I think it will help you, at least to some degree.)
 
Ziyad.

Links:
     1. http://patrick.wagstrom.net/tutorials/pygtkmozembed/pygtkmozembed.html





More information about the ubuntu-users mailing list