Advertisement
Guest User

Untitled

a guest
Dec 29th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root = Tk()
  4. root.resizable(width=False, height=False)
  5.  
  6.  
  7. S = Scrollbar(root)
  8. T = Text(root,state='disabled', height=30, width=100)
  9. T.configure(state="normal")
  10. S.pack(side=RIGHT, fill=Y)
  11. T.pack(side=LEFT, fill=Y)
  12. S.config(command=T.yview)
  13. T.config(yscrollcommand=S.set)
  14. quote = """HAMLET: To be, or not to be--that is the question:
  15. Whether 'tis nobler in the mind to suffer
  16. The slings and arrows of outrageous fortune
  17. Or to take arms against a sea of troubles
  18. And by opposing end them. To die, to sleep--
  19. No more--and by a sleep to say we end
  20. The heartache, and the thousand natural shocks
  21. That flesh is heir to. 'Tis a consummation
  22. Devoutly to be wished."""
  23. T.insert(END, quote)
  24. T.configure(state="disabled")
  25. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement