import gtkglade should be import gtk.glade note the period after gtk JT
On 5/4/2015 9:15 PM, chz wrote: > Hi all, > I‘m learning Glade3 Gtk Python Tutorial which was constributed by John > Thornton(thanks for JT very much). > http://gnipsel.com/glade/index.html > At tutorial 3 an error occurred, > when i typed the command "python3.4 glade1.py" in shell terminal,the result > was "GTK not available". > > > > > I don't know how to solve this problem.I need some help. > the following are some of my system information: > 1.Ubuntu 10.04 Linuxcnc OS > 2.Python3.4.3 > 3.Glade3 (GTK+ 2) > 4. > 5.the glade1.py > #!/usr/bin/env python > > > try: > import pygtk > pygtk.require('2.0') > except: > pass > try: > import gtk > import gtkglade > except: > print('GTK not available') > sys.exit(1) > > > class Buglump: > > > def on_window1_destroy(self, object, data=None): > print "quit with cancel" > gtk.main_quit() > > > def on_gtk_quit_activate(self, menuitem, data=None): > print "quit from menu" > gtk.main_quit() > > > def on_gtk_about_activate(self,object,data=None): > print "help about selected" > self.response=self.aboutdialog.run() > self.aboutdialog.hide() > > > def on_push_status_activate(self,menuitem,data=None): > self.status_count+=1 > self.status(self.context_id,"Messagenumber %s" % str(self.status_count)) > > > def on_pop_status_activate(self,menuitem,data=None): > self.status_count-=1 > self.statusbar.pop(self.context_id) > > > def on_clear_status_activate(self,menuitem,data=None): > while (status_count>0): > self.statusbar.pop(self.context_id) > self.status_count-=1 > > > def __init__(self): > self.gladefile = "tutorial-1.glade" > self.builder = gtk.Builder() > self.builder.add_from_file(self.gladefile) > self.builder.connect_signals(self) > self.window = self.builder.get_object("window1") > self.aboutdialog=self.builder.get_object("aboutdialog1") > self.context_id=self.statusbar.get_context_id("status") > self.status_count=0 > self.window.show() > > > if __name__ == "__main__": > main = Buglump() > gtk.main() > > > > > > > regards > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
