Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // execute funtion will call first two functions and finally call listener when a button1 in tkinter is clicked(which is not working as of now)
  2.  
  3. def execute():
  4. button1.config(state='disabled')
  5. capture()
  6. create_masterfile()
  7. #on_click(1, 1, button1, left)
  8.  
  9. def capture():
  10. label.config(text="Started")
  11.  
  12. def create_masterfile():
  13. //perform some actions
  14.  
  15. def on_click(x, y, button, pressed):
  16. print ("Mouse clicked")
  17. // Perform some actions
  18.  
  19. with Listener(on_click=on_click) as listener:
  20. listener.join()
  21.  
  22. app = Tk()
  23. app.title("Sample Application")
  24. app.geometry("500x200+100+100")
  25.  
  26. label = Label(app, text="Not Started", height=0, width=100)
  27. b = Button(app, text="Stop/Quit", width=20, command=app.destroy)
  28. button1 = Button(app, text="Start", width=20, command=execute)
  29. label.pack()
  30. b.pack(side='bottom',padx=0,pady=0)
  31. button1.pack(side='bottom',padx=5,pady=5)
  32.  
  33. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement