Class Tk::BWidget::ButtonBox
In: tk/lib/tkextlib/bwidget/buttonbox.rb
Parent: TkWindow

Methods

add   delete   index   insert   invoke   set_focus   tagid  

Included Modules

TkItemConfigMethod

Constants

TkCommandNames = ['ButtonBox'.freeze].freeze
WidgetClassName = 'ButtonBox'.freeze

Public Instance methods

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 41
  def add(keys={}, &b)
    win = window(tk_send('add', *hash_kv(keys)))
    win.instance_eval(&b) if b
    win
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 47
  def delete(idx)
    tk_send('delete', tagid(idx))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 52
  def index(idx)
    if idx.kind_of?(Tk::BWidget::Button)
      name = idx[:name]
      idx = name unless name.empty?
    end
    if idx.kind_of?(TkButton)
      idx = idx[:text]
    end
    number(tk_send('index', idx.to_s))
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 63
  def insert(idx, keys={}, &b)
    win = window(tk_send('insert', tagid(idx), *hash_kv(keys)))
    win.instance_eval(&b) if b
    win
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 69
  def invoke(idx)
    tk_send('invoke', tagid(idx))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 74
  def set_focus(idx)
    tk_send('setfocus', tagid(idx))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/buttonbox.rb, line 29
  def tagid(tagOrId)
    if tagOrId.kind_of?(Tk::BWidget::Button)
      name = tagOrId[:name]
      return index(name) unless name.empty?
    end
    if tagOrId.kind_of?(TkButton)
      return index(tagOrId[:text])
    end
    # index(tagOrId.to_s)
    index(_get_eval_string(tagOrId))
  end

[Validate]