Class | Tk::BLT::Tabset
In: | tk/lib/tkextlib/blt/tabset.rb
Parent: | TkWindow

### Methods

__boolval_optkeys __destroy_hook__ activate delete focus get_tab highlight index index_name insert invoke move_after move_before nearest perforation_highlight perforation_invoke scan_dragto scan_mark scrollcommand see select size tab_names tab_tearoff tabbind tabbind_append tabbind_remove tabbindinfo tagid tagindex view xscrollcommand xview

### Included Modules

X_Scrollable TkItemConfigMethod

### Classes and Modules

Class Tk::BLT::Tabset::NamedTab
Class Tk::BLT::Tabset::Tab

### Constants

TkCommandNames | = | ['::blt::tabset'.freeze].freeze
WidgetClassName | = | 'Tabset'.freeze

### External Aliases

itemcget | -> | tab_cget
itemconfigure | -> | tab_configure
itemconfiginfo | -> | tab_configinfo
current_itemconfiginfo | -> | current_tab_configinfo
xview_moveto | -> | view_moveto
xview_scroll | -> | view_scroll
xscrollbar | -> | scrollbar

### Public Instance methods

__boolval_optkeys()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 192
        def __boolval_optkeys
          super() << 'samewidth' << 'tearoff'
        end

__destroy_hook__()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 186
        def __destroy_hook__
          Tk::BLT::Tabset::Tab::TabID_TBL.delete(@path)
        end

activate(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 249
        def activate(index)
          tk_send('activate', tagindex(index))
          self
        end

delete(first, last=None)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 291
        def delete(first, last=None)
          tk_send('delete', tagindex(first), tagindex(last))
          if first.kind_of?(Tk::BLT::Tabset::Tab)
            TabID_TBL[@path].delete(first.id)
          end
          # middle tabs of the range are unknown
          if last.kind_of?(Tk::BLT::Tabset::Tab)
            TabID_TBL[@path].delete(last.id)
          end
          self
        end

focus(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 303
        def focus(index)
          tk_send('focus', tagindex(index))
          self
        end

get_tab(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 308
        def get_tab(index)
          Tk::BLT::Tabset::Tab.id2obj(tk_send_without_enc('get', tagindex(index)))
        end

highlight(index)

Alias for activate

index(str)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 312
        def index(str)
          num_or_str(tk_send('index', str))
        end

index_name(tab)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 315
        def index_name(tab)
          num_or_str(tk_send('index', '-mame', tagid(tab)))
        end

insert(pos, tab, keys={})

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 319
        def insert(pos, tab, keys={})
          Tk::BLT::Tabset::Tab.new(self, tagindex(pos), tagid(tab), keys)
        end

invoke(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 323
        def invoke(index)
          tk_send('invoke', tagindex(index))
        end

move_after(index, base_idx)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 331
        def move_after(index, base_idx)
          tk_send('move', tagindex(index), 'after', tagindex(base_idx))
          self
        end

move_before(index, base_idx)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 327
        def move_before(index, base_idx)
          tk_send('move', tagindex(index), 'before', tagindex(base_idx))
          self
        end

nearest(x, y)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 336
        def nearest(x, y)
          Tk::BLT::Tabset::Tab.id2obj(num_or_str(tk_send_without_enc('nearest', x, y)))
        end

perforation_highlight(index, mode)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 340
        def perforation_highlight(index, mode)
          tk_send('perforation', 'highlight', tagindex(index), mode)
          self
        end

perforation_invoke(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 344
        def perforation_invoke(index)
          tk_send('perforation', 'invoke', tagindex(index))
        end

scan_dragto(x, y)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 352
        def scan_dragto(x, y)
          tk_send_without_enc('scan', 'dragto', x, y)
          self
        end

scan_mark(x, y)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 348
        def scan_mark(x, y)
          tk_send_without_enc('scan', 'mark', x, y)
          self
        end

scrollcommand(cmd=Proc.new)

Alias for xscrollcommand

see(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 357
        def see(index)
          tk_send('see', tagindex(index))
          self
        end

select(index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 366
        def select(index)
          tk_send('select', tagindex(index))
          self
        end

size()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 362
        def size()
          number(tk_send_without_enc('size'))
        end

tab_names(pat=None)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 371
        def tab_names(pat=None)
          simplelist(tk_send('tab', 'names', pat)).collect{|name|
            Tk::BLT::Tabset::Tab.id2obj(name)
          }
        end

tab_tearoff(index, name=None)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 377
        def tab_tearoff(index, name=None)
          window(tk_send('tab', 'tearoff', tagindex(index), name))
        end

tabbind(tag, context, *args)

def tabbind(tag, context, cmd=Proc.new, *args)

      _bind([path, "bind", tagid(tag)], context, cmd, *args)
      self

end

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 259
        def tabbind(tag, context, *args)
          # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
          if TkComm._callback_entry?(args[0]) || !block_given?
            cmd = args.shift
          else
            cmd = Proc.new
          end
          _bind([path, "bind", tagid(tag)], context, cmd, *args)
          self
        end

tabbind_append(tag, context, *args)

def tabbind_append(tag, context, cmd=Proc.new, *args)

      _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
      self

end

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 273
        def tabbind_append(tag, context, *args)
          # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
          if TkComm._callback_entry?(args[0]) || !block_given?
            cmd = args.shift
          else
            cmd = Proc.new
          end
          _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
          self
        end

tabbind_remove(tag, context)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 283
        def tabbind_remove(tag, context)
          _bind_remove([path, "bind", tagid(tag)], context)
          self
        end

tabbindinfo(tag, context=nil)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 287
        def tabbindinfo(tag, context=nil)
          _bindinfo([path, "bind", tagid(tag)], context)
        end

tagid(tab)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 231
        def tagid(tab)
          if tab.kind_of?(Tk::BLT::Tabset::Tab)
            tab.id
          else
            tab
          end
        end

tagindex(tab)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 239
        def tagindex(tab)
          if tab.kind_of?(Tk::BLT::Tabset::Tab)
            tab.index
          else
            tab
          end
        end

view(*index)

Alias for xview

xscrollcommand(cmd=Proc.new)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 381
        def xscrollcommand(cmd=Proc.new)
          configure_cmd 'scrollcommand', cmd
          self
        end

xview(*index)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 387
        def xview(*index)
          if index.empty?
            list(tk_send_without_enc('view'))
          else
            tk_send_without_enc('view', *index)
            self
          end
        end

[Validate]