def poly args, key_args
      joinstyle, smooth, splinesteps =
      key_args.values_at(*%w{joinstyle smooth splinesteps})

      proc do |tkaroid, cos_r, sin_r|
        x = tkaroid.x
        y = tkaroid.y
        params = tkaroid.params

        coords = []
        points = args.map {|arg| arg[params] rescue arg}
        points.each_slice(2) do |xv, yv|
           coords << x + xv * cos_r - yv * sin_r
           coords << y + xv * sin_r + yv * cos_r
        end
        
        config = {}
        handle_generic_config(config, params, key_args)

        if joinstyle
          config[:joinstyle] = joinstyle[params] rescue joinstyle
        end
        if smooth
          config[:smooth] = smooth[params] rescue smooth
        end
        if splinesteps
          config[:splinesteps] = splinesteps[params] rescue splinesteps
        end

        [TkcPolygon, coords, config]
      end
    end
def poly args, key_args
      joinstyle, smooth, splinesteps =
      key_args.values_at(*%w{joinstyle smooth splinesteps})

      proc do |tkaroid, cos_r, sin_r|
        x = tkaroid.x
        y = tkaroid.y
        params = tkaroid.params

        coords = []
        points = args.map {|arg| arg[params] rescue arg}
        points.each_slice(2) do |xv, yv|
           coords << x + xv * cos_r - yv * sin_r
           coords << y + xv * sin_r + yv * cos_r
        end
        
        config = {}
        handle_generic_config(config, params, key_args)

        if joinstyle
          config[:joinstyle] = joinstyle[params] rescue joinstyle
        end
        if smooth
          config[:smooth] = smooth[params] rescue smooth
        end
        if splinesteps
          config[:splinesteps] = splinesteps[params] rescue splinesteps
        end

        [TkcPolygon, coords, config]
      end
    end
polyX1,Y1,X2,Y2,...key:val...

  joinstyle style (miter, bevel, round)
  smooth smoothMethod (true or false)
  splinesteps number