* ext/tk/lib/tk.rb: use epath for embedded windows of TkPanedWindow.

* ext/tk/lib/tktext.rb: use epath for embedded windows.
* ext/tk/lib/tkcanvas.rb: use epath for window items.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2004-01-07 05:28:53 +00:00
Родитель cd97e6e333
Коммит c24349e32d
4 изменённых файлов: 86 добавлений и 14 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Wed Jan 7 14:26:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (TkPanedWindow): use epath for embedded windows.
* ext/tk/lib/tktext.rb: use epath for embedded windows.
* ext/tk/lib/tkcanvas.rb: use epath for window items.
Wed Jan 7 14:24:04 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> Wed Jan 7 14:24:04 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* lib/soap/{attachment.rb,mimemessage.rb}: added from soap4r/1.5.2. * lib/soap/{attachment.rb,mimemessage.rb}: added from soap4r/1.5.2.

Просмотреть файл

@ -4830,16 +4830,18 @@ class TkPanedWindow<TkWindow
fail ArgumentError, "no window in arguments" unless keys fail ArgumentError, "no window in arguments" unless keys
if keys && keys.kind_of?(Hash) if keys && keys.kind_of?(Hash)
fail ArgumentError, "no window in arguments" if args == [] fail ArgumentError, "no window in arguments" if args == []
args += hash_kv(keys) args = args.collect{|w| w.epath}
args.push(hash_kv(keys))
else else
args.push(keys) if keys args.push(keys) if keys
args = args.collect{|w| w.epath}
end end
tk_send('add', *args) tk_send('add', *args)
self self
end end
def forget(win, *wins) def forget(win, *wins)
tk_send('forget', win, *wins) tk_send('forget', win.epath, *(wins.collect{|w| w.epath}))
self self
end end
alias del forget alias del forget
@ -4879,14 +4881,14 @@ class TkPanedWindow<TkWindow
end end
def panecget(win, key) def panecget(win, key)
tk_tcl2ruby(tk_send('panecget', win, "-#{key}")) tk_tcl2ruby(tk_send('panecget', win.epath, "-#{key}"))
end end
def paneconfigure(win, key, value=nil) def paneconfigure(win, key, value=nil)
if key.kind_of? Hash if key.kind_of? Hash
tk_send('paneconfigure', win, *hash_kv(key)) tk_send('paneconfigure', win.epath, *hash_kv(key))
else else
tk_send('paneconfigure', win, "-#{key}", value) tk_send('paneconfigure', win.epath, "-#{key}", value)
end end
self self
end end
@ -4894,11 +4896,12 @@ class TkPanedWindow<TkWindow
def paneconfiginfo(win, key=nil) def paneconfiginfo(win, key=nil)
if key if key
conf = tk_split_list(tk_send('paneconfigure', win, "-#{key}")) conf = tk_split_list(tk_send('paneconfigure', win.epath, "-#{key}"))
conf[0] = conf[0][1..-1] conf[0] = conf[0][1..-1]
conf conf
else else
tk_split_simplelist(tk_send('paneconfigure', win)).collect{|conflist| tk_split_simplelist(tk_send('paneconfigure',
win.epath)).collect{|conflist|
conf = tk_split_simplelist(conflist) conf = tk_split_simplelist(conflist)
conf[0] = conf[0][1..-1] conf[0] = conf[0][1..-1]
if conf[3] if conf[3]

Просмотреть файл

@ -862,6 +862,13 @@ end
class TkcWindow<TkcItem class TkcWindow<TkcItem
CItemTypeToClass['window'] = self CItemTypeToClass['window'] = self
def create_self(*args) def create_self(*args)
keys = args.pop
if keys && keys.kind_of?(Hash)
keys = _symbolkey2str(keys)
win = keys['window']
keys['window'] = win.epath if win.kind_of?(TkWindow)
end
args.push(keys) if keys
tk_call(@path, 'create', 'window', *args) tk_call(@path, 'create', 'window', *args)
end end
private :create_self private :create_self

Просмотреть файл

@ -499,8 +499,41 @@ class TkText<TkTextWin
index.configure(slot, value) index.configure(slot, value)
else else
if slot.kind_of? Hash if slot.kind_of? Hash
slot = _symbolkey2str(slot)
win = slot['window']
slot['window'] = win.epath if win.kind_of?(TkWindow)
if slot['create']
p_create = slot['create']
if p_create.kind_of? Proc
slot['create'] = install_cmd(proc{
id = p_create.call
if id.kind_of?(TkWindow)
id.epath
else
id
end
})
end
end
tk_send('window', 'configure', index, *hash_kv(slot)) tk_send('window', 'configure', index, *hash_kv(slot))
else else
if slot == 'window' || slot == :window
id = value
value = id.epath if id.kind_of?(TkWindow)
end
if slot == 'create' || slot == :create
p_create = value
if p_create.kind_of? Proc
value = install_cmd(proc{
id = p_create.call
if id.kind_of?(TkWindow)
id.epath
else
id
end
})
end
end
tk_send('window', 'configure', index, "-#{slot}", value) tk_send('window', 'configure', index, "-#{slot}", value)
end end
end end
@ -1177,10 +1210,18 @@ class TkTextWindow<TkObject
@index = @path.path @index = @path.path
keys = _symbolkey2str(keys) keys = _symbolkey2str(keys)
@id = keys['window'] @id = keys['window']
keys['window'] = @id.epath if @id.kind_of?(TkWindow)
if keys['create'] if keys['create']
@p_create = keys['create'] @p_create = keys['create']
if @p_create.kind_of? Proc if @p_create.kind_of? Proc
keys['create'] = install_cmd(proc{@id = @p_create.call; @id.path}) keys['create'] = install_cmd(proc{
@id = @p_create.call
if @id.kind_of?(TkWindow)
@id.epath
else
@id
end
})
end end
end end
tk_call @t.path, 'window', 'create', @index, *hash_kv(keys) tk_call @t.path, 'window', 'create', @index, *hash_kv(keys)
@ -1200,16 +1241,21 @@ class TkTextWindow<TkObject
def configure(slot, value=None) def configure(slot, value=None)
if slot.kind_of? Hash if slot.kind_of? Hash
slot = _symbolkey2str(slot) slot = _symbolkey2str(slot)
@id = slot['window'] if slot['window'] if slot['window']
@id = slot['window']
slot['window'] = @id.epath if @id.kind_of?(TkWindow)
end
if slot['create'] if slot['create']
self.create=value self.create=slot.delete('create')
slot['create']=nil
end end
if slot.size > 0 if slot.size > 0
tk_call(@t.path, 'window', 'configure', @index, *hash_kv(slot)) tk_call(@t.path, 'window', 'configure', @index, *hash_kv(slot))
end end
else else
@id = value if slot == 'window' || slot == :window if slot == 'window' || slot == :window
@id = value
value = @id.epath if @id.kind_of?(TkWindow)
end
if slot == 'create' || slot == :create if slot == 'create' || slot == :create
self.create=value self.create=value
else else
@ -1228,8 +1274,9 @@ class TkTextWindow<TkObject
end end
def window=(value) def window=(value)
tk_call @t.path, 'window', 'configure', @index, '-window', value
@id = value @id = value
value = @id.epath if @id.kind_of?(TkWindow)
tk_call @t.path, 'window', 'configure', @index, '-window', value
end end
def create def create
@ -1239,7 +1286,14 @@ class TkTextWindow<TkObject
def create=(value) def create=(value)
@p_create = value @p_create = value
if @p_create.kind_of? Proc if @p_create.kind_of? Proc
value = install_cmd(proc{@id = @p_create.call}) value = install_cmd(proc{
@id = @p_create.call
if @id.kind_of?(TkWindow)
@id.epath
else
@id
end
})
end end
tk_call @t.path, 'window', 'configure', @index, '-create', value tk_call @t.path, 'window', 'configure', @index, '-create', value
end end