summaryrefslogtreecommitdiff
path: root/trunk/ext/tk/sample/tksleep_sample.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
commitd0233291bc8a5068e52c69c210e5979e5324b5bc (patch)
tree7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/tk/sample/tksleep_sample.rb
parent0dc342de848a642ecce8db697b8fecd83a63e117 (diff)
parent72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff)
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/tk/sample/tksleep_sample.rb')
-rw-r--r--trunk/ext/tk/sample/tksleep_sample.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/trunk/ext/tk/sample/tksleep_sample.rb b/trunk/ext/tk/sample/tksleep_sample.rb
deleted file mode 100644
index 23f6eca54e..0000000000
--- a/trunk/ext/tk/sample/tksleep_sample.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'tk'
-
-v = TkVariable.new(0)
-l = TkLabel.new(:textvariable=>v).pack(:pady=>[1, 10])
-
-a = TkButton.new(:text=>"button A :: proc{p ['AAA', v.value]}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
-a.command{p ['AAA', v.value]}
-
-TkLabel.new(:text=>'Callback of the button B returns LIFO order').pack
-b = TkButton.new(:text=>"button B :: proc{n = v.value; p ['B:start', n]; Tk.sleep(10000); p ['B:end', n]}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
-b.command{n = v.value; p ['B:start', n]; Tk.sleep(10000); p ['B:end', n]}
-
-TkLabel.new(:text=>'Callback of the button C returns FIFO order').pack
-c = TkButton.new(:text=>"button C :: proc{n = v.value; Thread.new{p ['C:start', n]; Tk.sleep(10000); p ['C:end', n]}}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
-c.command{n = v.value; Thread.new{p ['C:start', n]; Tk.sleep(10000); p ['C:end', n]}}
-
-TkLabel.new(:text=>'Callback of the button D blocks eventloop (no respond to event)').pack
-d = TkButton.new(:text=>"button D :: proc{n = v.value; p ['D:start', n]; sleep(10); p ['D:end', n]}").pack(:fill=>:x, :pady=>[1,15], :padx=>15)
-d.command{n = v.value; p ['D:start', n]; sleep(10); p ['D:end', n]}
-
-TkLabel.new(:text=>'Callback of the button E is another way to avoid eventloop blocking').pack
-e = TkButton.new(:text=>"button E :: proc{n = v.value; Thread.new{p ['D:start', n]; sleep(10); p ['D:end', n]}}").pack(:fill=>:x, :pady=>[1,15], :padx=>15)
-e.command{n = v.value; Thread.new{p ['D:start', n]; sleep(10); p ['D:end', n]}}
-
-TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
-
-TkTimer.new(500, -1){v.numeric += 1}.start
-
-Tk.mainloop