Class: WindowBlessing::Widgets::Label

Inherits:
WindowBlessing::Window show all
Defined in:
lib/window_blessing/widgets/label.rb

Instance Attribute Summary

Attributes inherited from WindowBlessing::Window

#name

Attributes included from WindowBlessing::Window::Drawing

#buffer, #redraw_areas

Attributes included from WindowBlessing::Window::ParentsAndChildren

#children, #parent

Attributes included from WindowBlessing::Window::Geometry

#area

Attributes included from WindowBlessing::Window::KeyboardFocus

#focused, #focused_child

Instance Method Summary collapse

Methods inherited from WindowBlessing::Window

attr_accessor_with_redraw, #inspect, #route_pointer_event

Methods included from WindowBlessing::Window::Drawing

#add_redraw_area, #clear_redraw_areas, #draw, #draw_internal, #redraw, #redraw_requested?, #request_redraw, #request_redraw_internal

Methods included from WindowBlessing::Window::ParentsAndChildren

#add_child, #each_child, #each_child_with_index, #parent_path, #path, #remove_child

Methods included from WindowBlessing::Window::Geometry

#internal_area, #loc, #loc=, #move_onscreen, #size, #size=

Methods included from WindowBlessing::Window::KeyboardFocus

#blur, #blurred?, #focus, #focused?, #route_keyboard_event

Methods included from Evented

#event_manager, #handle_event, #on

Methods included from Tools

#buffer, #clone_value, #color, #fill_line, #gen_array2d, #gray_screen_color, #log, #overlapping_span, #overlay2d, #overlay_span, #range_length, #resize2d, #rgb_screen_color, #subarray2d, #window

Constructor Details

#initialize(rect, text, fill_options = {}) ⇒ Label

Returns a new instance of Label.



6
7
8
9
10
11
12
# File 'lib/window_blessing/widgets/label.rb', line 6

def initialize(rect, text, fill_options={})
  super rect
  @text = text
  @fg = fill_options[:fg]
  @bg = fill_options[:bg]
  request_redraw_internal
end

Instance Method Details

#draw_backgroundObject



16
17
18
19
# File 'lib/window_blessing/widgets/label.rb', line 16

def draw_background
  buffer.contents = text
  buffer.fill :fg => fg, :bg => bg
end

#pointer_inside?(loc) ⇒ Boolean

Returns:

  • (Boolean)


14
# File 'lib/window_blessing/widgets/label.rb', line 14

def pointer_inside?(loc) false; end