diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 05:10:59 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 05:10:59 +0000 |
commit | 5cd1282f21ad79859230978ac4eaf73f0853b0b4 (patch) | |
tree | e6f4b38b78fe4b020a366a2659ea8a0f2a885431 /ext/tk/lib/tk/text.rb | |
parent | 9a6c901fc431c58c0c607483ca2b41a20ceb4a4d (diff) |
* ext/tk/lib/multi-tk.rb: supports new features of Tcl/Tk8.5a2
* ext/tk/lib/tk/clock.rb: ditto
* ext/tk/lib/tk/text.rb: ditto
* ext/tk/lib/tk/panedwindow.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/text.rb')
-rw-r--r-- | ext/tk/lib/tk/text.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index f99337b3e9..8069adc57a 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -477,6 +477,11 @@ class TkText<TkTextWin info end + def peer_names() + # Tk8.5 feature + list(tk_send_without_enc('peer', 'names')) + end + def replace(idx1, idx2, *opts) tk_send('replace', idx1, idx2, *opts) self @@ -1373,3 +1378,25 @@ class TkText<TkTextWin dump(['image'], *index, &block) end end + +####################################### + +class TkText::Peer < TkText + # Tk8.5 feature + def initialize(text, parent=nil, keys={}) + unless text.kind_of?(TkText) + fail ArgumentError, "TkText is expected for 1st argument" + end + @src_text = text + super(parent, keys) + end + + def create_self(keys) + if keys and keys != None + tk_call_without_enc(@src_text.path, 'peer', 'create', @path) + else + tk_call_without_enc(@src_text.path, 'peer', 'create', @path) + end + end + private :create_self +end |