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

Methods

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

[Source]

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

[Source]

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

[Source]

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

[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

[Source]

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

[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

[Source]

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

[Source]

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

[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

[Source]

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

[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

[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

[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

[Source]

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

[Source]

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

[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

[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

[Source]

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

[Source]

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

[Source]

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

[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

[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

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

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

[Source]

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

[Source]

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

[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

[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

[Source]

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

[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]

ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.