summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/text.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 12:01:24 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 12:01:24 +0000
commitd062ab90e1d83bd53e7801ab9b7be82121bc628e (patch)
tree2a765634d3576fc61ed54278059a1268bc6ebf79 /ext/tk/lib/tk/text.rb
parentce4cda9de58a01dd1202222a5349064641f311f3 (diff)
Add lacks for Tk8.5 support.
* ext/tk/lib/tk.rb: add Tk.pkgconfig_list and Tk.pkgconfig_get [Tk8.5 feature]. * ext/tk/lib/tk/text.rb: supports new indices modifires on a Text widget [Tk8.5 feature]. * ext/tk/lib/tk/virtevent.rb: add TkNamedVirtualEvent. * ext/tk/lib/tk/autoload.rb: ditto. * ext/tk/lib/tk/event.rb: add :data key for virtual events [Tk8.5 feature]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/text.rb')
-rw-r--r--ext/tk/lib/tk/text.rb92
1 files changed, 92 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb
index bd5de278cf2..49d4b5625b7 100644
--- a/ext/tk/lib/tk/text.rb
+++ b/ext/tk/lib/tk/text.rb
@@ -103,6 +103,58 @@ class TkText<TkTextWin
end
alias char chars
+ def display_chars(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display chars')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display chars')
+ end
+ end
+ alias display_char display_chars
+
+ def any_chars(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any chars')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any chars')
+ end
+ end
+ alias any_char any_chars
+
+ def indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' indices')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' indices')
+ end
+ end
+
+ def display_indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display indices')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display indices')
+ end
+ end
+
+ def any_indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any indices')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any indices')
+ end
+ end
+
def lines(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
@@ -113,6 +165,28 @@ class TkText<TkTextWin
end
alias line lines
+ def display_lines(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display_lines')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display lines')
+ end
+ end
+ alias display_line display_lines
+
+ def any_lines(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ TkText::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any_lines')
+ else
+ TkText::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any lines')
+ end
+ end
+ alias any_line any_lines
+
def linestart
TkText::IndexString.new(String.new(id) << ' linestart')
end
@@ -120,12 +194,30 @@ class TkText<TkTextWin
TkText::IndexString.new(String.new(id) << ' lineend')
end
+ def display_linestart
+ # Tk8.5 feature
+ TkText::IndexString.new(String.new(id) << ' display linestart')
+ end
+ def display_lineend
+ # Tk8.5 feature
+ TkText::IndexString.new(String.new(id) << ' display lineend')
+ end
+
def wordstart
TkText::IndexString.new(String.new(id) << ' wordstart')
end
def wordend
TkText::IndexString.new(String.new(id) << ' wordend')
end
+
+ def display_wordstart
+ # Tk8.5 feature
+ TkText::IndexString.new(String.new(id) << ' display wordstart')
+ end
+ def display_wordend
+ # Tk8.5 feature
+ TkText::IndexString.new(String.new(id) << ' display wordend')
+ end
end
class IndexString < String