Wednesday, May 30, 2012

Starting dev on ubuntu 12.04 LTS : GTK (part 02)

Now we have our C launcher I'd like to see how it could work with Python.
Writing the next script give the same result as in C :

main.py :
#!/usr/bin/env python

import sys
import gtk
    
class TestProg:
    def on_window_destroy(self, widget, data=None):
        gtk.main_quit()
     
    def __init__(self):
    
        builder = gtk.Builder()
        builder.add_from_file("test.xml") 
        
        self.window = builder.get_object("window1")
        builder.connect_signals(self)       
    
if __name__ == "__main__":
    prog = TestProg()
    prog.window.show()
    gtk.main()


the next step is : how to react to my button...

No comments:

Post a Comment