Method: Fidgit::VerticalScrollBar#initialize
- Defined in:
- lib/fidgit/elements/scroll_bar.rb
#initialize(options = {}) ⇒ VerticalScrollBar
Returns a new instance of VerticalScrollBar.
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/fidgit/elements/scroll_bar.rb', line 96 def initialize( = {}) super @handle.width = width @handle_container.subscribe :left_mouse_button do |sender, x, y| distance = @owner.view_height @owner.offset_y += (y > @handle.y)? +distance : -distance end end |