diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-08 09:48:46 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-08 09:48:46 +0000 |
commit | 664342a30b6b156f331e2803d1912ef36a4ed977 (patch) | |
tree | 0a69c97c7fe59a0f86b3b1205453a35445987bfe | |
parent | dbc5d9feff71ba183e9a48a95087d8a1304050f2 (diff) | |
download | ruby-664342a30b6b156f331e2803d1912ef36a4ed977.tar.gz ruby-664342a30b6b156f331e2803d1912ef36a4ed977.tar.xz ruby-664342a30b6b156f331e2803d1912ef36a4ed977.zip |
* ext/tk/sample/tktextio.rb: add comment
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/tk/sample/tktextio.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/tk/sample/tktextio.rb b/ext/tk/sample/tktextio.rb index 068b28e60..8df245413 100644 --- a/ext/tk/sample/tktextio.rb +++ b/ext/tk/sample/tktextio.rb @@ -1,9 +1,18 @@ #!/usr/bin/env ruby # # sample class of handling I/O stream on a TkText widget -# # by Hidetoshi NAGAI # +# NOTE: TkTextIO supports 'character' (not 'byte') access only. +# So, for example, TkTextIO#getc returns a character, TkTextIO#pos +# means the character position, TkTextIO#read(size) counts by +# characters, and so on. +# Of course, it is available to make TkTextIO class to suuport +# 'byte' access. However, it may break multi-byte characters. +# and then, displayed string on the text widget may be garbled. +# I think that it is not good on the supposed situation of using +# TkTextIO. +# require 'tk' class TkTextIO < TkText @@ -50,7 +59,6 @@ class TkTextIO < TkText @open[:r] = true; @open[:w] = true @txtpos.set('end - 1 char') end - end def <<(obj) |