def method_missing(name, *args)  # :nodoc:
    # -- original perl comment --
    # There are two types of set methods: set_property() and
    # set_property_color(). When a method is AUTOLOADED we store a new anonymous
    # sub in the appropriate slot in the symbol table. The speeds up subsequent
    # calls to the same method.

    method = "#{name}"

    # Check for a valid method names, i.e. "set_xxx_yyy".
    method =~ /set_(\w+)/ or raise "Unknown method: #{method}\n"

    # Match the attribute, i.e. "@xxx_yyy".
    attribute = "@#{$1}"

    # Check that the attribute exists
    # ........
    if method =~ /set\w+color$/    # for "set_property_color" methods
      value = get_color(args[0])
    else                            # for "set_xxx" methods
      value = args[0].nil? ? 1 : args[0]
    end
    if value.respond_to?(:to_str) || !value.respond_to?(:+)
      s = %Q!#{attribute} = "#{value.to_s}"!
    else
      s = %Q!#{attribute} =   #{value.to_s}!
    end
    eval s
  end
def method_missing(name, *args)  # :nodoc:
    # -- original perl comment --
    # There are two types of set methods: set_property() and
    # set_property_color(). When a method is AUTOLOADED we store a new anonymous
    # sub in the appropriate slot in the symbol table. The speeds up subsequent
    # calls to the same method.

    method = "#{name}"

    # Check for a valid method names, i.e. "set_xxx_yyy".
    method =~ /set_(\w+)/ or raise "Unknown method: #{method}\n"

    # Match the attribute, i.e. "@xxx_yyy".
    attribute = "@#{$1}"

    # Check that the attribute exists
    # ........
    if method =~ /set\w+color$/    # for "set_property_color" methods
      value = get_color(args[0])
    else                            # for "set_xxx" methods
      value = args[0].nil? ? 1 : args[0]
    end
    if value.respond_to?(:to_str) || !value.respond_to?(:+)
      s = %Q!#{attribute} = "#{value.to_s}"!
    else
      s = %Q!#{attribute} =   #{value.to_s}!
    end
    eval s
  end
Dynamically create set methods that aren't already defined.