class TheFox::TermKit::CellTableView

Attributes

highlighted[R]

Public Class Methods

new(subview, name = nil) click to toggle source
Calls superclass method TheFox::TermKit::View.new
# File lib/termkit/view/view_table_cell.rb, line 9
def initialize(subview, name = nil)
    name = "CellTableView_#{object_id}" if name.nil?
    super(name)
    
    @highlighted = false
    
    add_subview(subview)
end

Public Instance Methods

highlighted=(highlighted) click to toggle source
# File lib/termkit/view/view_table_cell.rb, line 18
def highlighted=(highlighted)
    if @highlighted != highlighted
        if highlighted
            foreground_color = :color_white
            background_color = :color_blue
        end
        @grid_cache.each do |y_pos, row|
            row.each do |x_pos, content|
                content.foreground_color = foreground_color
                content.background_color = background_color
            end
        end
    end
    
    @highlighted = highlighted
end