Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

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) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/autoscroll.rb, line 64
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) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/autoscroll.rb, line 86
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