summaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/tktextio.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-10 10:14:13 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-10 10:14:13 +0000
commit5c0a7a0d5d2cb1bb22b7d2668510d659d67fd86d (patch)
tree8afc849e858fd04167e578c92c2ae02f1da24f69 /ext/tk/sample/tktextio.rb
parentf3637570526dc41ab5d8c508a21e25f0a9fbde31 (diff)
downloadruby-5c0a7a0d5d2cb1bb22b7d2668510d659d67fd86d.tar.gz
ruby-5c0a7a0d5d2cb1bb22b7d2668510d659d67fd86d.tar.xz
ruby-5c0a7a0d5d2cb1bb22b7d2668510d659d67fd86d.zip
* ext/tcltklib/tcltklib.c (lib_eventloop_ensure): mis-delete a timer
handler when exit from a recursive called eventloop * ext/tk/lib/tk/timer.rb: new TkRTTimer class, which can works for a realtime operation * ext/tk/sample/tkrttimer.rb: sample of TkRTTimer class * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to TkText::IndexModMethods * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and add them to TkText::IndexModMethods module * ext/tk/sample/tktextio.rb: add test part of "seek by text index modifiers" git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tktextio.rb')
-rw-r--r--ext/tk/sample/tktextio.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/tk/sample/tktextio.rb b/ext/tk/sample/tktextio.rb
index fecedf6ee..cb59c2d9d 100644
--- a/ext/tk/sample/tktextio.rb
+++ b/ext/tk/sample/tktextio.rb
@@ -581,5 +581,23 @@ if __FILE__ == $0
STDOUT.print("\n================================================\n\n")
+ STDOUT.print("\n========= reverse order (seek by lines) ========\n\n")
+
+ tio.seek(-1, IO::SEEK_END)
+ begin
+ begin
+ tio.seek(:linestart, IO::SEEK_CUR)
+ rescue
+ # maybe use old version of tk/textmark.rb
+ tio.seek('0 char linestart', IO::SEEK_CUR)
+ end
+ STDOUT.print(gets)
+ tio.seek('-1 char linestart -1 char', IO::SEEK_CUR)
+ end while(tio.pos > 0)
+
+ STDOUT.print("\n================================================\n\n")
+
+ tio.seek(0, IO::SEEK_END)
+
Tk.mainloop
end