diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 08:57:35 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 08:57:35 +0000 |
commit | 59a07a0690ea964aa1f6d2f250a9ef176cac49ab (patch) | |
tree | b75ba8b89ab8151fdcb14b9b358bb18c88afbc41 /ext/tk/lib/tk/text.rb | |
parent | d66a188c4a1aa269be94c5707df3aeff185dd076 (diff) |
Ruby/Tk :: provisional support on Ruby-VM and Tcl/Tk8.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/text.rb')
-rw-r--r-- | ext/tk/lib/tk/text.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index 49d4b5625b..352d0903f4 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -60,7 +60,7 @@ module TkTextTagConfig private :itemconfiginfo, :current_itemconfiginfo end -class TkText<TkTextWin +class Tk::Text<TkTextWin ItemConfCMD = ['tag'.freeze, 'configure'.freeze].freeze #include TkTreatTextTagFont include TkTextTagConfig @@ -1183,6 +1183,11 @@ class TkText<TkTextWin end def _ktext_length(txt) + if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!! + return txt.length + end + ########################### + if $KCODE !~ /n/i return txt.gsub(/[^\Wa-zA-Z_\d]/, ' ').length end @@ -1527,6 +1532,9 @@ class TkText<TkTextWin end end +TkText = Tk::Text unless Object.const_defined? :TkText + + ####################################### class TkText::Peer < TkText |