Advertisement
bhok

Untitled

Jun 10th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import filedialog
  3.  
  4.  
  5. class Application(tk.Frame):
  6. def __init__(self, parent):
  7. tk.Frame.__init__(self, parent)
  8. self.parent = parent
  9. self.pack()
  10. self.createWidgets()
  11.  
  12. def createWidgets(self):
  13.  
  14. #save button
  15. self.saveLabel = tk.Label(self.parent, text="Save File", padx=10, pady=10)
  16. self.saveLabel.pack()
  17. #I'm trying to get command to call the test function from documentMaker
  18. self.saveButton = tk.Button(self.parent, text = "Save", command = hello)
  19. self.saveButton.pack()
  20.  
  21.  
  22. class documentMaker():
  23. def test(self):
  24.  
  25. print ("hello people")
  26.  
  27. root = tk.Tk()
  28. app = Application(root)
  29. app.master.title('Sample application')
  30. object = documentMaker()
  31. hello = object.test()
  32.  
  33.  
  34. #object.convert()
  35. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement