Class: WindowBlessing::Widgets::Label
- Inherits:
-
WindowBlessing::Window
- Object
- WindowBlessing::Window
- WindowBlessing::Widgets::Label
- Defined in:
- lib/window_blessing/widgets/label.rb
Instance Attribute Summary
Attributes inherited from WindowBlessing::Window
Attributes included from WindowBlessing::Window::Drawing
Attributes included from WindowBlessing::Window::ParentsAndChildren
Attributes included from WindowBlessing::Window::Geometry
Attributes included from WindowBlessing::Window::KeyboardFocus
Instance Method Summary collapse
- #draw_background ⇒ Object
-
#initialize(rect, text, fill_options = {}) ⇒ Label
constructor
A new instance of Label.
- #pointer_inside?(loc) ⇒ Boolean
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, ={}) super rect @text = text @fg = [:fg] @bg = [:bg] request_redraw_internal end |
Instance Method Details
#draw_background ⇒ Object
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
14 |
# File 'lib/window_blessing/widgets/label.rb', line 14 def pointer_inside?(loc) false; end |