summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk/text.rb')
-rw-r--r--ext/tk/lib/tk/text.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb
index d294de9fd9..c75cc2d5be 100644
--- a/ext/tk/lib/tk/text.rb
+++ b/ext/tk/lib/tk/text.rb
@@ -131,6 +131,10 @@ class TkText<TkTextWin
class IndexString < String
include IndexModMethods
+ def self.at(x,y)
+ self.new("@#{x},#{y}")
+ end
+
def self.new(str)
if str.kind_of?(String)
super(str)
@@ -183,6 +187,14 @@ class TkText<TkTextWin
end
private :create_self
+ def self.at(x, y)
+ TkText::IndexString.at(x, y)
+ end
+
+ def at(x, y)
+ TkText::IndexString.at(x, y)
+ end
+
def index(idx)
TkText::IndexString.new(tk_send_without_enc('index',
_get_eval_enc_str(idx)))