class RETerm::Components::ScrollingArea

Scrolling Area CDK Component

Attributes

lines[RW]
title[RW]

Public Class Methods

new(args={}) click to toggle source

Initialize the ScrollingArea component

@param [Hash] args scrolling area params @option args [String] :title title of area @option args [Integer] :lines number of lines

in the area
Calls superclass method RETerm::Component::new
# File lib/reterm/components/scrolling_area.rb, line 15
def initialize(args={})
  super
  @title  = args[:title] || ""
  @lines  = args[:lines] || 10
end

Public Instance Methods

<<(item) click to toggle source
# File lib/reterm/components/scrolling_area.rb, line 34
def <<(item)
  component.add item, CDK::BOTTOM
end
activatable?() click to toggle source

XXX swindow results in weird keyboard interactions, disable for now

# File lib/reterm/components/scrolling_area.rb, line 22
def activatable?
  false
end
requested_cols() click to toggle source
# File lib/reterm/components/scrolling_area.rb, line 30
def requested_cols
  [@title.size, 10].min
end
requested_rows() click to toggle source
# File lib/reterm/components/scrolling_area.rb, line 26
def requested_rows
  10
end

Private Instance Methods

_component() click to toggle source
# File lib/reterm/components/scrolling_area.rb, line 40
def _component
  CDK::SWINDOW.new(window.cdk_scr, # cdkscreen,
                   0, 1,           # xplace, yplace, scroll pos
                   window.rows,    # widget height
                   window.cols,    # widget width
                   @title, @lines, # title, lines
                   true, false)    # box, shadow
end