LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   python + glade problems (https://www.linuxquestions.org/questions/linux-software-2/python-glade-problems-455249/)

pwrlftr220 06-15-2006 10:26 PM

python + glade problems
 
I am running Ubuntu 6.06 and am trying to create a simple gui with glade and python. I believe I have all the packages that I need installed, but I am running into an error that says "global name 'libglade' is not defined". The code that I am using is below. The gui is simply a window with a single label. The relevant packages that I have installed are python, python-gtk2, python-glade2, glade, libglade2-0. The error comes up on the line: "self.widgets = libglade.GladeXML ('pyglade.glade', "window1")" Does anyone know why I am getting this error?

#!/usr/bin/env python

import gtk, gtk.glade

class GladeHandlers:
pass
class WidgetsWrapper:
def __init__(self):
self.widgets = libglade.GladeXML ('pyglade.glade', "window1")
self.widgets.signal_autoconnect(GladeHandlers.__dict__)
def __getitem__(self, key):
return self.widgets.get_widget(key)
widgets = WidgetsWrapper()

gtk.mainloop ()

elpuerco 10-09-2006 08:43 AM

You need to install libglade through synaptic and then it will work


All times are GMT -5. The time now is 03:20 PM.