Module: Tk::Scrollable (Ruby 2.3.4)

In Files

  • tk/lib/tk/scrollable.rb
  • tk/lib/tkextlib/tcllib/autoscroll.rb

Class/Module Index [+]

Quicksearch

Tk::Scrollable

Public Instance Methods

autoscroll(mode = nil)
 
               # File tk/lib/tkextlib/tcllib/autoscroll.rb, line 65
def autoscroll(mode = nil)
  case mode
  when :x, 'x'
    if @xscrollbar
      Tk::Tcllib::Autoscroll.autoscroll(@xscrollbar)
    end
  when :y, 'y'
    if @yscrollbar
      Tk::Tcllib::Autoscroll.autoscroll(@yscrollbar)
    end
  when nil, :both, 'both'
    if @xscrollbar
      Tk::Tcllib::Autoscroll.autoscroll(@xscrollbar)
    end
    if @yscrollbar
      Tk::Tcllib::Autoscroll.autoscroll(@yscrollbar)
    end
  else
    fail ArgumentError, "'x', 'y' or 'both' (String or Symbol) is expected"
  end
  self
end
            
unautoscroll(mode = nil)
 
               # File tk/lib/tkextlib/tcllib/autoscroll.rb, line 87
def unautoscroll(mode = nil)
  case mode
  when :x, 'x'
    if @xscrollbar
      Tk::Tcllib::Autoscroll.unautoscroll(@xscrollbar)
    end
  when :y, 'y'
    if @yscrollbar
      Tk::Tcllib::Autoscroll.unautoscroll(@yscrollbar)
    end
  when nil, :both, 'both'
    if @xscrollbar
      Tk::Tcllib::Autoscroll.unautoscroll(@xscrollbar)
    end
    if @yscrollbar
      Tk::Tcllib::Autoscroll.unautoscroll(@yscrollbar)
    end
  else
    fail ArgumentError, "'x', 'y' or 'both' (String or Symbol) is expected"
  end
  self
end