/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import gtk import sys import pygtk import gtk.glade calcFirst = 1 a = 0 b = 0 class App: """This is an Hello World GTK application""" def __init__(self): #Set the Glade file self.gladefile = "testccc_4.glade" self.wTree = gtk.glade.XML(self.gladefile) dic = {"clicke" : self.equal , "clicko" : self.addOne , "clickp" : self.plus} self.wTree.signal_autoconnect(dic) def addOne(self, widget): """Called when the use wants to add a wine""" #Cteate the dialog, show it, and store the results entryx = self.wTree.get_widget("entry1") entryx.set_text(entryx.get_text()+"1") def equal(self, widget): """Called when the use wants to add a wine""" #Cteate the dialog, show it, and store the results entryx = self.wTree.get_widget("entry1") entryx.set_text(entryx.get_text()+"1") def aaaas(self): """Called when the use wants to add a wine""" #Cteate the dialog, show it, and store the results entryx = self.wTree.get_widget("entry1") entryx.set_text(entryx.get_text()+"1") if __name__ == "__main__": app = App() gtk.main()