diff options
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/lib/tk.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkafter.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkcanvas.rb | 11 | ||||
-rw-r--r-- | ext/tk/lib/tktext.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkvirtevent.rb | 6 | ||||
-rw-r--r-- | ext/tk/tkutil.c | 2 |
6 files changed, 10 insertions, 23 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 6dd832b942..bb3f7f6ab8 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -470,7 +470,7 @@ module TkCore end def rb_appsend(interp, async, *args) - args = args.filter{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} args.push(').to_s"') appsend(interp, async, 'ruby "(', *args) end @@ -485,7 +485,7 @@ module TkCore end def rb_appsend_displayof(interp, win, async, *args) - args = args.filter{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[][$"]/, '\\\\\&')} args.push(').to_s"') appsend_displayof(interp, win, async, 'ruby "(', *args) end @@ -526,7 +526,7 @@ module TkCore def tk_call(*args) print args.join(" "), "\n" if $DEBUG - args.filter {|x|_get_eval_string(x)} + args.collect! {|x|_get_eval_string(x)} args.compact! args.flatten! begin diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb index be2e50ff3a..55bfde4d52 100644 --- a/ext/tk/lib/tkafter.rb +++ b/ext/tk/lib/tkafter.rb @@ -26,7 +26,7 @@ class TkAfter end def TkAfter.info - tk_call('after', 'info').split(' ').filter{|id| + tk_call('after', 'info').split(' ').collect!{|id| ret = Tk_CBTBL.find{|key,val| val.after_id == id} (ret == nil)? id: ret[1] } diff --git a/ext/tk/lib/tkcanvas.rb b/ext/tk/lib/tkcanvas.rb index 80c36f6ed8..914bfe01e3 100644 --- a/ext/tk/lib/tkcanvas.rb +++ b/ext/tk/lib/tkcanvas.rb @@ -216,7 +216,7 @@ class TkCanvas<TkWindow end def find(mode, *args) - list(tk_send 'find', mode, *args).filter{|id| + list(tk_send 'find', mode, *args).collect!{|id| TkcItem.id2obj(id) } end @@ -368,13 +368,6 @@ class TkCanvas<TkWindow def itemtype(tag) TkcItem.type2class(tk_send 'type', tagid(tag)) end - - def xview(*index) - tk_send 'xview', *index - end - def yview(*index) - tk_send 'yview', *index - end end module TkcTagAccess @@ -725,7 +718,7 @@ class TkImage<TkObject end def TkImage.names - Tk.tk_call('image', 'names').split.filter{|id| + Tk.tk_call('image', 'names').split.collect!{|id| (Tk_IMGTBL[id])? Tk_IMGTBL[id] : id } end diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index 2b5fb9138e..163583f139 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -245,16 +245,10 @@ class TkText<TkTextWin (inf == "")? [0,0,0,0,0]: inf end - def yview(*what) - tk_send 'yview', *what - end def yview_pickplace(*what) tk_send 'yview', '-pickplace', *what end - def xview(*what) - tk_send 'xview', *what - end def xview_pickplace(*what) tk_send 'xview', '-pickplace', *what end diff --git a/ext/tk/lib/tkvirtevent.rb b/ext/tk/lib/tkvirtevent.rb index 0d100c2186..b31b99062f 100644 --- a/ext/tk/lib/tkvirtevent.rb +++ b/ext/tk/lib/tkvirtevent.rb @@ -16,7 +16,7 @@ class TkVirtualEvent<TkObject end def TkVirtualEvent.info - tk_call('event', 'info').split(/\s+/).filter{|seq| + tk_call('event', 'info').split(/\s+/).collect!{|seq| TkVirtualEvent.getobj(seq[1..-2]) } end @@ -49,8 +49,8 @@ class TkVirtualEvent<TkObject end def info - tk_call('event', 'info', "<#{@id}>").split(/\s+/).filter{|seq| - l = seq.scan(/<*[^<>]+>*/).filter{|subseq| + tk_call('event', 'info', "<#{@id}>").split(/\s+/).collect!{|seq| + l = seq.scan(/<*[^<>]+>*/).collect!{|subseq| case (subseq) when /^<<[^<>]+>>$/ TkVirtualEvent.getobj(subseq[1..-2]) diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c index 9d4ca0a9d0..6cfdad973b 100644 --- a/ext/tk/tkutil.c +++ b/ext/tk/tkutil.c @@ -29,7 +29,7 @@ tk_s_new(argc, argv, klass) { VALUE obj = rb_class_new_instance(argc, argv, klass); - if (rb_iterator_p()) rb_obj_instance_eval(0, 0, obj); + if (rb_block_given_p()) rb_obj_instance_eval(0, 0, obj); return obj; } |