In Files

  • tk/lib/tkextlib/bwidget/buttonbox.rb

Class/Module Index [+]

Quicksearch

Tk::BWidget::ButtonBox

Public Instance Methods

add(keys={}, &b) click to toggle 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
            
delete(idx) click to toggle source
 
               # File tk/lib/tkextlib/bwidget/buttonbox.rb, line 47
def delete(idx)
  tk_send('delete', tagid(idx))
  self
end
            
index(idx) click to toggle 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
            
insert(idx, keys={}, &b) click to toggle 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
            
invoke(idx) click to toggle source
 
               # File tk/lib/tkextlib/bwidget/buttonbox.rb, line 69
def invoke(idx)
  tk_send('invoke', tagid(idx))
  self
end
            
set_focus(idx) click to toggle source
 
               # File tk/lib/tkextlib/bwidget/buttonbox.rb, line 74
def set_focus(idx)
  tk_send('setfocus', tagid(idx))
  self
end
            
tagid(tagOrId) click to toggle 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