1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/lib/tk/canvas.rb: *** POTENTIALLY INCOMPATIBLE ***

'tags' option of a TkcItem object gives a list of TkcTag objects.
* ext/tk/lib/tkextlib/vu/dial.rb: fix logical bug.
* ext/tk/lib/tk/canvas.rb, ext/tk/lib/tkextlib/blt/component.rb: 
  lack of support for methodcall_optkeys.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2009-10-05 21:29:32 +00:00
parent 40229f892c
commit cb732bbbdc
4 changed files with 24 additions and 8 deletions

View file

@ -1,3 +1,13 @@
Tue Oct 6 06:26:00 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* * ext/tk/lib/tk/canvas.rb: *** POTENTIALLY INCOMPATIBLE ***
'tags' option of a TkcItem object should give a list of TkcTag objs.
* ext/tk/lib/tkextlib/vu/dial.rb: fix logical bug.
* ext/tk/lib/tk/canvas.rb, ext/tk/lib/tkextlib/blt/component.rb:
lack of support for methodcall_optkeys.
Mon Oct 5 12:22:12 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_{times, shuffle_bang, sample}): reducing macro

View file

@ -25,7 +25,10 @@ module TkCanvasItemConfig
private :__item_methodcall_optkeys
def __item_val2ruby_optkeys(id) # { key=>proc, ... }
super(id).update('window'=>proc{|i, v| window(v)})
super(id).update('window'=>proc{|i, v| window(v)},
'tags'=>proc{|i, v|
simplelist(v).collect{|tag| TkcTag.id2obj(self, tag)}
})
end
private :__item_val2ruby_optkeys
@ -690,7 +693,7 @@ class TkcItem<TkObject
args = args.flatten
end
[args, fontkeys]
[args, fontkeys, methodkeys]
end
private_class_method :_parse_create_args
@ -698,10 +701,11 @@ class TkcItem<TkObject
unless self::CItemTypeName
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys = _parse_create_args(args)
args, fontkeys, methodkeys = _parse_create_args(args)
idnum = tk_call_without_enc(canvas.path, 'create',
self::CItemTypeName, *args)
canvas.itemconfigure(idnum, fontkeys) unless fontkeys.empty?
canvas.itemconfigure(idnum, methodkeys) unless methodkeys.empty?
idnum.to_i # 'canvas item id' is an integer number
end
########################################

View file

@ -1268,7 +1268,7 @@ module Tk::BLT
args = []
end
[args, fontkeys]
[args, fontkeys, methodkeys]
end
private_class_method :_parse_create_args
@ -1276,18 +1276,20 @@ module Tk::BLT
unless self::MarkerTypeName
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys = _parse_create_args(keys)
args, fontkeys, methodkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
self::MarkerTypeName, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
idnum.to_i # 'item id' is an integer number
end
def self.create_type(chart, type, keys={})
args, fontkeys = _parse_create_args(keys)
args, fontkeys, methodkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
type, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
id = idnum.to_i # 'item id' is an integer number
obj = self.allocate
obj.instance_eval{

View file

@ -32,10 +32,10 @@ class Tk::Vu::Dial < TkWindow
def coords(val = nil)
if val
tk_split_list(tk_send_without_enc('coords'))
else
tk_send_without_enc('coords', val)
self
else
tk_split_list(tk_send_without_enc('coords'))
end
end