def color_pair(*val)
       if val.empty?
         #return @color_pair 
         return @color_pair || get_color($datacolor, color(), bgcolor())
       end

       oldvalue = @color_pair
       case val.size
       when 1
         raise ArgumentError, "Expecting fixnum for color_pair." unless val[0].is_a? Integer
         @color_pair = val[0]
         @color, @bgcolor = ColorMap.get_colors_for_pair @color_pair
       when 2
         @color = val.first if val.first
         @bgcolor = val.last if val.last
         @color_pair = get_color $datacolor, @color, @bgcolor
       end
       if oldvalue != @color_pair
         fire_property_change(:color_pair, oldvalue, @color_pair)
         @property_changed = true
         repaint_all true
       end
       self
     end
def color_pair(*val)
       if val.empty?
         #return @color_pair 
         return @color_pair || get_color($datacolor, color(), bgcolor())
       end

       oldvalue = @color_pair
       case val.size
       when 1
         raise ArgumentError, "Expecting fixnum for color_pair." unless val[0].is_a? Integer
         @color_pair = val[0]
         @color, @bgcolor = ColorMap.get_colors_for_pair @color_pair
       when 2
         @color = val.first if val.first
         @bgcolor = val.last if val.last
         @color_pair = get_color $datacolor, @color, @bgcolor
       end
       if oldvalue != @color_pair
         fire_property_change(:color_pair, oldvalue, @color_pair)
         @property_changed = true
         repaint_all true
       end
       self
     end
returns array of events defined for this object
 @deprecated, should be in eventhandler
def event_list
return @_events if defined? @_events
nil
end
 2011-11-12 trying to make color setting a bit sane
 You may set as a color_pair using get_color which gives a fixnum
 or you may give 2 color symbols so i can update color, bgcolor and colorpair in one shot
 if one of them is nil, i just use the existing value