Advertisement
Guest User

Untitled

a guest
May 6th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. require 'tk'
  2.  
  3. root = TkRoot.new
  4. root.title = "Window"
  5.  
  6. canvas = TkCanvas.new(root) do
  7. place('height' => 170, 'width' => 100,
  8. 'x' => 10, 'y' => 10)
  9. end
  10.  
  11. TkcLine.new(canvas, 0, 10, 100, 10,
  12. 'width' => 10, 'fill' => "blue")
  13. TkcLine.new(canvas, 0, 30, 100, 30,
  14. 'width' => 10, 'fill' => "red")
  15. TkcLine.new(canvas, 0, 50, 100, 50,
  16. 'width' => 10, 'fill' => "green")
  17. TkcLine.new(canvas, 0, 70, 100, 70,
  18. 'width' => 10, 'fill' => "violet")
  19. TkcLine.new(canvas, 0, 90, 100, 90,
  20. 'width' => 10, 'fill' => "yellow")
  21. TkcLine.new(canvas, 0, 110, 100, 110,
  22. 'width' => 10, 'fill' => "pink")
  23. TkcLine.new(canvas, 0, 130, 100, 130,
  24. 'width' => 10, 'fill' => "orange")
  25. TkcLine.new(canvas, 0, 150, 100, 150,
  26. 'width' => 10, 'fill' => "grey")
  27. Tk.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement