Module: Tk::XScrollable
- Included in:
- BLT::Tabset, Scrollable
- Defined in:
- lib/tk/scrollable.rb
Instance Method Summary collapse
- #xscrollbar(bar = nil) ⇒ Object
- #xscrollcommand(cmd = nil, &block) ⇒ Object
- #xview(*index) ⇒ Object
- #xview_moveto(*index) ⇒ Object
- #xview_scroll(*index) ⇒ Object
Instance Method Details
#xscrollbar(bar = nil) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/tk/scrollable.rb', line 31 def (=nil) if @xscrollbar = @xscrollbar.orient 'horizontal' self.xscrollcommand {|*arg| @xscrollbar.set(*arg)} @xscrollbar.command {|*arg| self.xview(*arg)} Tk.update # avoid scrollbar trouble end @xscrollbar end |
#xscrollcommand(cmd = nil, &block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/tk/scrollable.rb', line 9 def xscrollcommand(cmd=nil, &block) cmd ||= block configure_cmd 'xscrollcommand', cmd # Tk.update # avoid scrollbar trouble self end |
#xview(*index) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/tk/scrollable.rb', line 16 def xview(*index) if index.size == 0 list(tk_send_without_enc('xview')) else tk_send_without_enc('xview', *index) self end end |
#xview_moveto(*index) ⇒ Object
24 25 26 |
# File 'lib/tk/scrollable.rb', line 24 def xview_moveto(*index) xview('moveto', *index) end |
#xview_scroll(*index) ⇒ Object
27 28 29 |
# File 'lib/tk/scrollable.rb', line 27 def xview_scroll(*index) xview('scroll', *index) end |