hi im study programming by Gtk3 and i try to using glade i installed it, But when i try to load the file from glade I have the problem:
" AttributeError: 'gi.repository.Gtk' object has no attribute 'glade' "
or this when I using only (Gtk.Builder):
" AttributeError: 'Builder' object has no attribute 'glade' "
I know i should to install glade in python3 But I dont now how to install it after download it >>__<<
thank U pleas help me
#!/usr/bin/python3.3
from gi.repository import Gtk
import pygtk
gu= Gtk.Builder()
gui = gu.glade.XML("1111.glade")
"AttributeError: 'Builder' object has no attribute 'glade'
#!/usr/bin/python3.3
from gi.repository import Gtk
import pygtk
gui = Gtk.glade.XML("1111.glade")
" AttributeError: 'gi.repository.Gtk' object has no attribute 'glade' "
GTK objects don't have a glade
property. Given a Gtk.Builder
object gu
, you should be calling something like gu.add_from_file("1111.glade")
.
Also, don't import pygtk
when working with GTK 3. PyGTK only supports GTK 2; GTK 3 is automatically handled by Python bindings for gobject-introspection, which you get when importing gi.repository
.