add(keys={}, &b)
click to toggle source
def add(keys={}, &b)
win = window(tk_send('add', *hash_kv(keys)))
if b
if TkCore::WITH_RUBY_VM
win.instance_exec(self, &b)
else
win.instance_eval(&b)
end
end
win
end
cget(slot)
click to toggle source
def cget(slot)
if slot.to_s == 'relative'
super('parent')
else
super(slot)
end
end
cget_strict(slot)
click to toggle source
def cget_strict(slot)
if slot.to_s == 'relative'
super('parent')
else
super(slot)
end
end
cget_tkstring(slot)
click to toggle source
def cget_tkstring(slot)
if slot.to_s == 'relative'
super('parent')
else
super(slot)
end
end
configinfo(slot=nil)
click to toggle source
def configinfo(slot=nil)
if slot
if slot.to_s == 'relative'
super('parent')
else
super(slot)
end
else
ret = super()
if TkComm::GET_CONFIGINFO_AS_ARRAY
ret << ['relative', 'parent']
else
ret['relative'] = 'parent'
end
end
end
create_self(keys)
click to toggle source
def create_self(keys)
cmd = self.class::TkCommandNames[0]
if keys and keys != None
tk_call_without_enc(cmd, @path, '-parent', @relative,
*hash_kv(keys, true))
else
tk_call_without_enc(cmd, @path, '-parent', @relative)
end
end
draw(focus_win=None)
click to toggle source
def draw(focus_win=None)
tk_send('draw', focus_win)
end
enddialog(ret)
click to toggle source
def enddialog(ret)
tk_send('enddialog', ret)
end
get_frame(&b)
click to toggle source
def get_frame(&b)
win = window(tk_send('getframe'))
if b
if TkCore::WITH_RUBY_VM
win.instance_exec(self, &b)
else
win.instance_eval(&b)
end
end
win
end
index(idx)
click to toggle source
def index(idx)
get_buttonbox.index(idx)
end
invoke(idx)
click to toggle source
def invoke(idx)
tk_send('invoke', tagid(idx))
self
end
set_focus(idx)
click to toggle source
def set_focus(idx)
tk_send('setfocus', tagid(idx))
self
end
tagid(tagOrId)
click to toggle source
def tagid(tagOrId)
if tagOrId.kind_of?(Tk::BWidget::Button)
name = tagOrId[:name]
return index(name) unless name.empty?
end
if tagOrId.kind_of?(Tk::Button)
return index(tagOrId[:text])
end
index(_get_eval_string(tagOrId))
end
withdraw()
click to toggle source
def withdraw
tk_send('withdraw')
self
end