diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-01 09:42:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-01 09:42:38 +0000 |
commit | fedf48986da718580062d081dda38c4ee182c254 (patch) | |
tree | 65e06d76c544a8d80296d686bf88ec3af41fdc50 /ext/tk/lib/tktext.rb | |
parent | acbb1c943457d3b8802f099ee0e34331bc78bd38 (diff) |
2000-05-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tktext.rb')
-rw-r--r-- | ext/tk/lib/tktext.rb | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index e1939af5fe..2b5fb9138e 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -428,15 +428,9 @@ class TkText<TkTextWin rsearch_with_length(pat,start,stop)[0] end - def dump(type_info, *index) - args = type_info.collect{|inf| - if inf.kind_of? Array - inf[0] = '-' + inf[0] - inf - else - '-' + inf - end - }.flatten + def dump(type_info, *index, &block) + args = type_info.collect{|inf| '-' + inf} + args << '-command' << Proc.new(&block) if iterator? str = tk_send('dump', *(args + index)) result = [] sel = nil @@ -546,26 +540,23 @@ class TkText<TkTextWin end private :_retrieve_backslashed_text - def dump_all(*index) - dump(['all'], *index) + def dump_all(*index, &block) + dump(['all'], *index, &block) end - def dump_command(cmd, *index) - dump([['command', cmd]], *index) + def dump_mark(*index, &block) + dump(['mark'], *index, &block) end - def dump_mark(*index) - dump(['mark'], *index) + def dump_tag(*index, &block) + dump(['tag'], *index, &block) end - def dump_tag(*index) - dump(['tag'], *index) + def dump_text(*index, &block) + dump(['text'], *index, &block) end - def dump_text(*index) - dump(['text'], *index) + def dump_window(*index, &block) + dump(['window'], *index, &block) end - def dump_window(*index) - dump(['window'], *index) - end - def dump_image(*index) - dump(['image'], *index) + def dump_image(*index, &block) + dump(['image'], *index, &block) end end |