Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'tk'
- root = TkRoot.new
- root.title = "Window"
- canvas = TkCanvas.new(root) do
- place('height' => 170, 'width' => 100,
- 'x' => 10, 'y' => 10)
- end
- TkcLine.new(canvas, 0, 10, 100, 10,
- 'width' => 10, 'fill' => "blue")
- TkcLine.new(canvas, 0, 30, 100, 30,
- 'width' => 10, 'fill' => "red")
- TkcLine.new(canvas, 0, 50, 100, 50,
- 'width' => 10, 'fill' => "green")
- TkcLine.new(canvas, 0, 70, 100, 70,
- 'width' => 10, 'fill' => "violet")
- TkcLine.new(canvas, 0, 90, 100, 90,
- 'width' => 10, 'fill' => "yellow")
- TkcLine.new(canvas, 0, 110, 100, 110,
- 'width' => 10, 'fill' => "pink")
- TkcLine.new(canvas, 0, 130, 100, 130,
- 'width' => 10, 'fill' => "orange")
- TkcLine.new(canvas, 0, 150, 100, 150,
- 'width' => 10, 'fill' => "grey")
- Tk.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement