Chongkkmy
Posts: 1
Joined: Fri Mar 15, 2013 12:41 am

Gtk object has no attribute gdk[help]

Sun Mar 31, 2013 9:25 am

Hi, guys

I'm trying to create multiple threading in my GTK glade, which requires Gtk.gdk but i received error about gdk.

Code: Select all

try:  
    import pygtk
    pygtk.require("2.0")  
except:  
    pass  

try:  
    from gi.repository import Gtk
except:  
    print("GTK Not Available")
    sys.exit(1)

Gtk.gdk.threads_init()
This is the error i receive
AttributeError: ' gi.repository import Gtk' object has no attribute 'gdk'
Any Ideas? Thanks

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Gtk object has no attribute gdk[help]

Sun Mar 31, 2013 11:01 am

Try...

Code: Select all

import pygtk
pygtk.require('2.0')
import gtk
Don't bother with try/except and all that.

Let us know how it goes.
Dave.
Apple say... Monkey do !!

Return to “Python”