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 | 8a73532bd86d237cc6314015821a84523b0e2bbf (patch) | |
tree | 10a1470f37a79aff08d1c0e0459b4b46b06d91da /ext/tk/lib/tk/text.rb | |
parent | fd71f860a1f73a244964673003092424f670bea9 (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/branches/ruby_1_8@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 |