diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-01 16:09:54 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-01 16:09:54 +0000 |
commit | 4c4631c2daaf7b2418c1f0e39292c8ee27a64813 (patch) | |
tree | dfeb96c4772df8caba4e01e749c8f3e1262f8fe0 /ext/tcltklib/demo/lines3.rb | |
parent | ce23680755e4e9ab0eed9dc6adb091ef7f1c58cb (diff) | |
download | ruby-4c4631c2daaf7b2418c1f0e39292c8ee27a64813.tar.gz |
* renewal Ruby/Tk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib/demo/lines3.rb')
-rw-r--r-- | ext/tcltklib/demo/lines3.rb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/tcltklib/demo/lines3.rb b/ext/tcltklib/demo/lines3.rb new file mode 100644 index 0000000000..caa50f92e7 --- /dev/null +++ b/ext/tcltklib/demo/lines3.rb @@ -0,0 +1,54 @@ +#! /usr/local/bin/ruby + +require "tk" + +def drawlines() + print Time.now, "\n" + + for j in 0 .. 99 + print "*" + $stdout.flush + if (j & 1) != 0 + col = "blue" + else + col = "red" + end + for i in 0 .. 99 +# $a.create(TkcLine, i, 0, 0, 500 - i, "fill"=>col) + end + end + + print Time.now, "\n" + + for j in 0 .. 99 + print "*" + $stdout.flush + if (j & 1) != 0 + col = "blue" + else + col = "red" + end + for i in 0 .. 99 + $a.create(TkcLine, i, 0, 0, 500 - i, "fill"=>col) + end + end + + print Time.now, "\n" +# Tk.root.destroy +end + +$a = TkCanvas.new{ + height(500) + width(500) +} + +$b = TkButton.new{ + text("draw") + command(proc{drawlines()}) +} + +TkPack.configure($a, $b, {"side"=>"left"}) + +Tk.mainloop + +# eof |