stupid netbeans (or I)


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import gtk
  2. import sys
  3. import pygtk
  4. import gtk.glade
  5.  
  6. calcFirst = 1
  7. a = 0
  8. b = 0
  9.  
  10. class App:
  11. """This is an Hello World GTK application"""
  12.  
  13. def __init__(self):
  14. #Set the Glade file
  15. self.gladefile = "testccc_4.glade"
  16. self.wTree = gtk.glade.XML(self.gladefile)
  17.  
  18. dic = {"clicke" : self.equal
  19. , "clicko" : self.addOne
  20. , "clickp" : self.plus}
  21. self.wTree.signal_autoconnect(dic)
  22.  
  23. def addOne(self, widget):
  24. """Called when the use wants to add a wine"""
  25. #Cteate the dialog, show it, and store the results
  26. entryx = self.wTree.get_widget("entry1")
  27. entryx.set_text(entryx.get_text()+"1")
  28.  
  29. def equal(self, widget):
  30. """Called when the use wants to add a wine"""
  31. #Cteate the dialog, show it, and store the results
  32. entryx = self.wTree.get_widget("entry1")
  33. entryx.set_text(entryx.get_text()+"1")
  34.  
  35. def aaaas(self):
  36. """Called when the use wants to add a wine"""
  37. #Cteate the dialog, show it, and store the results
  38. entryx = self.wTree.get_widget("entry1")
  39. entryx.set_text(entryx.get_text()+"1")
  40.  
  41.  
  42.  
  43. if __name__ == "__main__":
  44. app = App()
  45. gtk.main()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.