Method: Fidgit::ScrollWindow#initialize

Defined in:
lib/fidgit/elements/scroll_window.rb

#initialize(options = {}) ⇒ ScrollWindow

Returns a new instance of ScrollWindow.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fidgit/elements/scroll_window.rb', line 18

def initialize(options = {})
  options = {
    scroll_bar_thickness: default(:scroll_bar_thickness),
  }.merge! options

  super(options)

  @grid = grid num_columns: 2, padding: 0, spacing: 0 do
    @view = scroll_area(owner: self, width: options[:width], height: options[:height])
    @spacer = label '', padding: 0, width: 0, height: 0
  end

  @scroll_bar_v = VerticalScrollBar.new(owner: self, width: options[:scroll_bar_thickness], align_v: :fill)
  @scroll_bar_h = HorizontalScrollBar.new(owner: self, height: options[:scroll_bar_thickness], align_h: :fill)
end