Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pygtk Builder problem - builder not defined
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
102jon




PostPosted: Mon Mar 14, 2011 7:49 am   Post subject: Pygtk Builder problem - builder not defined

Hi, I'm building an interface with pygtk/glade, however i am having a problem with gtkBuilder. In my code:

code:
import gtk
import string
import os, sys
import subprocess

class GadTool:
        def on_filechooserdialog1_destroy(self, widget):
                gtk.main_quit()
               
        def __init__(self):
                builder = gtk.Builder()
        builder.add_from_file("CSA_Tool.glade")       
        self.window = builder.get_object("filechooserdialog1")
        builder.connect_signals(self)
       
    #def on_filechooserdialog1_file_activated(self):
       
   
if __name__ == "__main__":
    interface = GadTool()
    interface.window.show()
    gtk.main()


There is a problem on the line "builder.add_from_file" etc. It says builder is not defined. What is the problem?
Sponsor
Sponsor
Sponsor
sponsor
102jon




PostPosted: Mon Mar 14, 2011 7:50 am   Post subject: RE:Pygtk Builder problem - builder not defined

by the way the code is indented properly, it came out wrong for some reason here.
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: