add(*args)
click to toggle source
def add(*args)
keys = args.pop
fail ArgumentError, "no window in arguments" unless keys
if keys && keys.kind_of?(Hash)
fail ArgumentError, "no window in arguments" if args == []
opts = hash_kv(keys)
else
args.push(keys) if keys
opts = []
end
args.each{|win|
tk_send_without_enc('add', _epath(win), *opts)
}
self
end
current_pane_configinfo(win, key=nil)
click to toggle source
current_paneconfiginfo(win, key=nil)
click to toggle source
def current_paneconfiginfo(win, key=nil)
if TkComm::GET_CONFIGINFO_AS_ARRAY
if key
conf = paneconfiginfo(win, key)
{conf[0] => conf[4]}
else
ret = {}
paneconfiginfo(win).each{|conf|
ret[conf[0]] = conf[4] if conf.size > 2
}
ret
end
else
ret = {}
paneconfiginfo(win, key).each{|k, conf|
ret[k] = conf[-1] if conf.kind_of?(Array)
}
ret
end
end
forget(pane)
click to toggle source
def forget(pane)
pane = _epath(pane)
tk_send_without_enc('forget', pane)
self
end
identify(x, y)
click to toggle source
def identify(x, y)
num_or_nil(tk_send_without_enc('identify', x, y))
end
insert(pos, win, keys)
click to toggle source
def insert(pos, win, keys)
win = _epath(win)
tk_send_without_enc('insert', pos, win, *hash_kv(keys))
self
end
pane_cget(pane, slot)
click to toggle source
pane_cget_strict(pane, slot)
click to toggle source
pane_cget_tkstring(pane, slot)
click to toggle source
pane_config(pane, key, value=nil)
click to toggle source
pane_configinfo(win)
click to toggle source
panecget(pane, slot)
click to toggle source
def panecget(pane, slot)
unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
panecget_strict(pane, slot)
else
begin
panecget_strict(pane, slot)
rescue => e
begin
if current_paneconfiginfo(pane).has_key?(slot.to_s)
fail e
else
nil
end
rescue
fail e
end
end
end
end
panecget_strict(pane, slot)
click to toggle source
def panecget_strict(pane, slot)
pane = _epath(pane)
tk_tcl2ruby(tk_send_without_enc('pane', pane, "-#{slot}"))
end
panecget_tkstring(pane, slot)
click to toggle source
def panecget_tkstring(pane, slot)
pane = _epath(pane)
tk_send_without_enc('pane', pane, "-#{slot}")
end
paneconfiginfo(win)
click to toggle source
def paneconfiginfo(win)
if TkComm::GET_CONFIGINFO_AS_ARRAY
win = _epath(win)
if key
conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
conf[0] = conf[0][1..-1]
if conf[0] == 'hide'
conf[3] = bool(conf[3]) unless conf[3].empty?
conf[4] = bool(conf[4]) unless conf[4].empty?
end
conf
else
tk_split_simplelist(tk_send_without_enc('pane',
win)).collect{|conflist|
conf = tk_split_simplelist(conflist)
conf[0] = conf[0][1..-1]
if conf[3]
if conf[0] == 'hide'
conf[3] = bool(conf[3]) unless conf[3].empty?
elsif conf[3].index('{')
conf[3] = tk_split_list(conf[3])
else
conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[0] == 'hide'
conf[4] = bool(conf[4]) unless conf[4].empty?
elsif conf[4].index('{')
conf[4] = tk_split_list(conf[4])
else
conf[4] = tk_tcl2ruby(conf[4])
end
end
conf[1] = conf[1][1..-1] if conf.size == 2
conf
}
end
else
win = _epath(win)
if key
conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
key = conf.shift[1..-1]
if key == 'hide'
conf[2] = bool(conf[2]) unless conf[2].empty?
conf[3] = bool(conf[3]) unless conf[3].empty?
end
{ key => conf }
else
ret = {}
tk_split_simplelist(tk_send_without_enc('pane',
win)).each{|conflist|
conf = tk_split_simplelist(conflist)
key = conf.shift[1..-1]
if key
if key == 'hide'
conf[2] = bool(conf[2]) unless conf[2].empty?
elsif conf[2].index('{')
conf[2] = tk_split_list(conf[2])
else
conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if key == 'hide'
conf[3] = bool(conf[3]) unless conf[3].empty?
elsif conf[3].index('{')
conf[3] = tk_split_list(conf[3])
else
conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf.size == 1
ret[key] = conf[0][1..-1]
else
ret[key] = conf
end
}
ret
end
end
end
panes()
click to toggle source
def panes
tk_split_simplelist(tk_send_without_enc('panes')).map{|w|
(obj = window(w))? obj: w
}
end
sashpos(idx, newpos=None)
click to toggle source
def sashpos(idx, newpos=None)
num_or_str(tk_send_without_enc('sashpos', idx, newpos))
end