Shoes.app do
	@strokebool = false
	@anstype = 1
	stack do
		background black, :height => 40
		flow :margin => 10 do 
			caption "Sketchers", :stroke => white, :margin_right => 25
			button("line")  { @anstype = 1 }
			button("arrow") { @anstype = 2 }
			button("star")  { @anstype = 3 }
			button("rect")  { @anstype = 4 }
			button("oval")  { @anstype = 5 }
			button("stroke color") { stroke_fun }
		end
	end
	click do
		if @strokebool == false
			start
			@strokebool = true
		end
	end
	release do
		if @strokebool == true
			motion nil
			@strokebool = false
		end
	end
	def start
		x, y = nil, nil
		motion do |_x, _y|
			if x and y and (x != _x or y != _y)
				append do
					case @anstype
						when 1
							line x, y, _x, _y
						when 2
							arrow x, y, 10
						when 3
							star x, y, 5, 10, 50
						when 4
							rect x, y, 10, 10
						when 5
							oval x, y, 10, 10
					end
				end
			end
			x, y = _x, _y
		end
	end
	def stroke_fun
		@answer = ask_color("Pick a Color")
		stroke @answer
		fill @answer
	end
end