aspect(*args)
click to toggle source
def aspect(*args)
if args.length == 0
list(tk_call_without_enc('wm', 'aspect', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call('wm', 'aspect', path, *args)
self
end
end
attributes(slot=nil,value=None)
click to toggle source
def attributes(slot=nil,value=None)
if slot == nil
lst = tk_split_list(tk_call('wm', 'attributes', path))
info = {}
while key = lst.shift
info[key[1..-1]] = lst.shift
end
info
elsif slot.kind_of? Hash
tk_call('wm', 'attributes', path, *hash_kv(slot))
self
elsif value == None
tk_call('wm', 'attributes', path, "-#{slot}")
else
tk_call('wm', 'attributes', path, "-#{slot}", value)
self
end
end
client(name=None)
click to toggle source
def client(name=None)
if name == None
tk_call('wm', 'client', path)
else
name = '' if name == nil
tk_call('wm', 'client', path, name)
self
end
end
colormapwindows(*args)
click to toggle source
def colormapwindows(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'colormapwindows', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'colormapwindows', path, *args)
self
end
end
deiconify(ex = true)
click to toggle source
def deiconify(ex = true)
if ex
tk_call_without_enc('wm', 'deiconify', path)
else
self.iconify
end
self
end
focusmodel(mode = nil)
click to toggle source
def focusmodel(mode = nil)
if mode
tk_call_without_enc('wm', 'focusmodel', path, mode)
self
else
tk_call_without_enc('wm', 'focusmodel', path)
end
end
frame()
click to toggle source
def frame
tk_call_without_enc('wm', 'frame', path)
end
geometry(geom=nil)
click to toggle source
def geometry(geom=nil)
if geom
tk_call_without_enc('wm', 'geometry', path, geom)
self
else
tk_call_without_enc('wm', 'geometry', path)
end
end
group(leader = nil)
click to toggle source
def group(leader = nil)
if leader
tk_call('wm', 'group', path, leader)
self
else
window(tk_call('wm', 'group', path))
end
end
iconbitmap(bmp=nil)
click to toggle source
def iconbitmap(bmp=nil)
if bmp
tk_call_without_enc('wm', 'iconbitmap', path, bmp)
self
else
image_obj(tk_call_without_enc('wm', 'iconbitmap', path))
end
end
iconify(ex = true)
click to toggle source
def iconify(ex = true)
if ex
tk_call_without_enc('wm', 'iconify', path)
else
self.deiconify
end
self
end
iconmask(bmp=nil)
click to toggle source
def iconmask(bmp=nil)
if bmp
tk_call_without_enc('wm', 'iconmask', path, bmp)
self
else
image_obj(tk_call_without_enc('wm', 'iconmask', path))
end
end
iconname(name=nil)
click to toggle source
def iconname(name=nil)
if name
tk_call('wm', 'iconname', path, name)
self
else
tk_call('wm', 'iconname', path)
end
end
iconphoto(*imgs)
click to toggle source
def iconphoto(*imgs)
if imgs.empty?
@wm_iconphoto = nil unless defined? @wm_iconphoto
return @wm_iconphoto
end
imgs = imgs[0] if imgs.length == 1 && imgs[0].kind_of?(Array)
tk_call_without_enc('wm', 'iconphoto', path, *imgs)
@wm_iconphoto = imgs
self
end
iconphoto_default(*imgs)
click to toggle source
def iconphoto_default(*imgs)
imgs = imgs[0] if imgs.length == 1 && imgs[0].kind_of?(Array)
tk_call_without_enc('wm', 'iconphoto', path, '-default', *imgs)
self
end
iconposition(*args)
click to toggle source
def iconposition(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'iconposition', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'iconposition', path, *args)
self
end
end
iconwindow(win = nil)
click to toggle source
def iconwindow(win = nil)
if win
tk_call_without_enc('wm', 'iconwindow', path, win)
self
else
w = tk_call_without_enc('wm', 'iconwindow', path)
(w == '')? nil: window(w)
end
end
maxsize(*args)
click to toggle source
def maxsize(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'maxsize', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'maxsize', path, *args)
self
end
end
minsize(*args)
click to toggle source
def minsize(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'minsize', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'minsize', path, *args)
self
end
end
overrideredirect(mode=None)
click to toggle source
def overrideredirect(mode=None)
if mode == None
bool(tk_call_without_enc('wm', 'overrideredirect', path))
else
tk_call_without_enc('wm', 'overrideredirect', path, mode)
self
end
end
positionfrom(who=None)
click to toggle source
def positionfrom(who=None)
if who == None
r = tk_call_without_enc('wm', 'positionfrom', path)
(r == "")? nil: r
else
tk_call_without_enc('wm', 'positionfrom', path, who)
self
end
end
protocol(name=nil, cmd=nil, &b)
click to toggle source
def protocol(name=nil, cmd=nil, &b)
if cmd
tk_call_without_enc('wm', 'protocol', path, name, cmd)
self
elsif b
tk_call_without_enc('wm', 'protocol', path, name, proc(&b))
self
elsif name
result = tk_call_without_enc('wm', 'protocol', path, name)
(result == "")? nil : tk_tcl2ruby(result)
else
tk_split_simplelist(tk_call_without_enc('wm', 'protocol', path))
end
end
protocols(kv=nil)
click to toggle source
def protocols(kv=nil)
unless kv
ret = {}
self.protocol.each{|name|
ret[name] = self.protocol(name)
}
return ret
end
unless kv.kind_of?(Hash)
fail ArgumentError, 'expect a hash of protocol=>command'
end
kv.each{|k, v| self.protocol(k, v)}
self
end
resizable(*args)
click to toggle source
def resizable(*args)
if args.length == 0
list(tk_call_without_enc('wm', 'resizable', path)).collect{|e| bool(e)}
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'resizable', path, *args)
self
end
end
sizefrom(who=None)
click to toggle source
def sizefrom(who=None)
if who == None
r = tk_call_without_enc('wm', 'sizefrom', path)
(r == "")? nil: r
else
tk_call_without_enc('wm', 'sizefrom', path, who)
self
end
end
stackorder()
click to toggle source
def stackorder
list(tk_call('wm', 'stackorder', path))
end
stackorder_isabove(win)
click to toggle source
def stackorder_isabove(win)
bool(tk_call('wm', 'stackorder', path, 'isabove', win))
end
stackorder_isbelow(win)
click to toggle source
def stackorder_isbelow(win)
bool(tk_call('wm', 'stackorder', path, 'isbelow', win))
end
state(st=nil)
click to toggle source
def state(st=nil)
if st
tk_call_without_enc('wm', 'state', path, st)
self
else
tk_call_without_enc('wm', 'state', path)
end
end
title(str=nil)
click to toggle source
def title(str=nil)
if str
tk_call('wm', 'title', path, str)
self
else
tk_call('wm', 'title', path)
end
end
transient(master=nil)
click to toggle source
def transient(master=nil)
if master
tk_call_without_enc('wm', 'transient', path, master)
self
else
window(tk_call_without_enc('wm', 'transient', path))
end
end
withdraw(ex = true)
click to toggle source
def withdraw(ex = true)
if ex
tk_call_without_enc('wm', 'withdraw', path)
else
self.deiconify
end
self
end
wm_command(value=nil)
click to toggle source
def wm_command(value=nil)
if value
tk_call('wm', 'command', path, value)
self
else
tk_call('wm', 'command', path)
end
end
wm_grid(*args)
click to toggle source
def wm_grid(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'grid', path))
else
args = args[0] if args.length == 1 && args[0].kind_of?(Array)
tk_call_without_enc('wm', 'grid', path, *args)
self
end
end