summaryrefslogtreecommitdiff
path: root/ext/tk/lib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-05 21:29:32 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-05 21:29:32 +0000
commitcb732bbbdc94d2a969f5f727d6018b9d7d3e291c (patch)
tree3331815a48d58f514ff661e3c53d60abfd511c56 /ext/tk/lib
parent40229f892c6877ecd0d45f24b662b05c74c7774a (diff)
* 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
Diffstat (limited to 'ext/tk/lib')
-rw-r--r--ext/tk/lib/tk/canvas.rb10
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb8
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb4
3 files changed, 14 insertions, 8 deletions
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb
index 602139e00a2..f0cb755bd76 100644
--- a/ext/tk/lib/tk/canvas.rb
+++ b/ext/tk/lib/tk/canvas.rb
@@ -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
########################################
diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb
index 20db035fdd2..a228a822461 100644
--- a/ext/tk/lib/tkextlib/blt/component.rb
+++ b/ext/tk/lib/tkextlib/blt/component.rb
@@ -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{
diff --git a/ext/tk/lib/tkextlib/vu/dial.rb b/ext/tk/lib/tkextlib/vu/dial.rb
index eca0bbb67c1..4d04974a55d 100644
--- a/ext/tk/lib/tkextlib/vu/dial.rb
+++ b/ext/tk/lib/tkextlib/vu/dial.rb
@@ -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