summaryrefslogtreecommitdiffstats
path: root/ext/tk
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-01 09:42:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-01 09:42:38 +0000
commit817a62de81d75c73cceb453301ef27b094f17c14 (patch)
tree65e06d76c544a8d80296d686bf88ec3af41fdc50 /ext/tk
parent5cffff58445b5aec50bd4abe2198bf84b8dd68c4 (diff)
downloadruby-817a62de81d75c73cceb453301ef27b094f17c14.tar.gz
ruby-817a62de81d75c73cceb453301ef27b094f17c14.tar.xz
ruby-817a62de81d75c73cceb453301ef27b094f17c14.zip
2000-05-01
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r--ext/tk/lib/tktext.rb39
1 files changed, 15 insertions, 24 deletions
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
index e1939af5f..2b5fb9138 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