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

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

### Methods

bind bind_append bind_remove bindinfo cget configinfo configure current_configinfo delete focus get_name id2obj index invoke move_after move_before new new perforation_highlight perforation_invoke see tearoff

### Included Modules

TkTreatItemFont

### Constants

TabID_TBL | = | TkCore::INTERP.create_table
TabsetTab_ID | = | ['blt_tabset_tab'.freeze, '00000'.taint].freeze

### Public Class methods

id2obj(tabset, id)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 19
          def self.id2obj(tabset, id)
            tpath = tabset.path
            return id unless TabID_TBL[tpath]
            TabID_TBL[tpath][id]? TabID_TBL[tpath]: id
          end

new(parent, pos, name, keys)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 43
          def initialize(parent, pos, name, keys)
            @t = parent
            @tpath = parent.path
            if name
              @path = @id = name
              TabID_TBL[@tpath] = {} unless TabID_TBL[@tpath]
              TabID_TBL[@tpath][@id] = self

              unless (list(tk_call(@tpath, 'tab', 'names', @id)).empty?)
                if pos
                  idx = tk_call(@tpath, 'index', '-name', @id)
                  if pos.to_s == 'end'
                    tk_call(@tpath, idx, 'moveto', 'after', 'end')
                  else
                    tk_call(@tpath, idx, 'moveto', 'before', pos)
                  end
                end
                tk_call(@tpath, 'tab', 'configure', @id, keys)
                return
              end

            else
              @path = @id = TabsetTab_ID.join(TkCore::INTERP._ip_id_)
              TabID_TBL[@tpath] = {} unless TabID_TBL[@tpath]
              TabID_TBL[@tpath][@id] = self
              TabsetTab_ID[1].succ!
            end

            pos = 'end' unless pos
            tk_call(@tpath, 'insert', pos, @id, keys)
          end

new(parent, pos=nil, name=nil, keys={})

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 25
          def self.new(parent, pos=nil, name=nil, keys={})
            if pos.kind_of?(Hash)
              keys = pos
              name = nil
              pos  = nil
            end
            if name.kind_of?(Hash)
              keys = name
              name = nil
            end

            if name && TabID_TBL[parent.path] && TabID_TBL[parent.path][name]
              TabID_TBL[parent.path][name]
            else
              super(parent, pos, name, keys)
            end
          end

### Public Instance methods

bind(context, *args)

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

      @t.tab_bind(@id, context, cmd, *args)
      self

end

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 79
          def bind(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
            @t.tab_bind(@id, context, cmd, *args)
            self
          end

bind_append(context, *args)

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

      @t.tab_bind_append(@id, context, cmd, *args)
      self

end

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 93
          def bind_append(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
            @t.tab_bind_append(@id, context, cmd, *args)
            self
          end

bind_remove(context)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 103
          def bind_remove(context)
            @t.tab_bind_remove(@id, context)
            self
          end

bindinfo(context=nil)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 107
          def bindinfo(context=nil)
            @t.tab_bindinfo(@id, context)
          end

cget(*args)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 111
          def cget(*args)
            @t.tab_cget(@id, *args)
          end

configinfo(*args)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 117
          def configinfo(*args)
            @t.tab_configinfo(@id, *args)
          end

configure(*args)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 114
          def configure(*args)
            @t.tab_configure(@id, *args)
          end

current_configinfo(*args)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 120
          def current_configinfo(*args)
            @t.current_tab_configinfo(@id, *args)
          end

delete()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 124
          def delete()
            @t.delete(@id)
            TabID_TBL[@tpath].delete(@id)
            self
          end

focus()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 134
          def focus()
            @t.focus(self.index)
          end

get_name()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 130
          def get_name()
            @id.dup
          end

index()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 138
          def index()
            @t.index_name(@id)
          end

invoke()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 142
          def invoke()
            @t.invoke(self.index)
          end

move_after(idx)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 149
          def move_after(idx)
            @t.move_after(self.index, idx)
          end

move_before(idx)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 146
          def move_before(idx)
            @t.move_before(self.index, idx)
          end

perforation_highlight(mode)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 153
          def perforation_highlight(mode)
            @t.perforation.highlight(self.index, mode)
          end

perforation_invoke()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 156
          def perforation_invoke()
            @t.perforation.invoke(self.index)
          end

see()

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 160
          def see()
            @t.see(self.index)
          end

tearoff(name=None)

[Source]

    # File tk/lib/tkextlib/blt/tabset.rb, line 164
          def tearoff(name=None)
            @t.tab_tearoff(self.index, *args)
          end

[Validate]