diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-07 07:38:25 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-07 07:38:25 +0000 |
commit | 9ff1e787f915539b1980654e3d3d2013ff5c81d2 (patch) | |
tree | 8d0fc9ca5b4dbfa9885dc56862292d55091bcaac /ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb | |
parent | 441546edcfbb1b346c87b69c5f578d1a0e522e06 (diff) |
wrong commit; sorryv1_8_6_269
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb')
-rw-r--r-- | ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb b/ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb deleted file mode 100644 index 636b85813b..0000000000 --- a/ruby_1_8_6/ext/tk/sample/demos-en/vscale.rb +++ /dev/null @@ -1,78 +0,0 @@ -# vscale.rb -# -# This demonstration script shows an example with a vertical scale. - -require "tkcanvas" - -if defined?($vscale_demo) && $vscale_demo - $vscale_demo.destroy - $vscale_demo = nil -end - -$vscale_demo = TkToplevel.new {|w| - title("Vertical Scale Demonstration") - iconname("vscale") -} -positionWindow($vscale_demo) - -msg = TkLabel.new($vscale_demo) { - font $font - wraplength '3.5i' - justify 'left' - text "An arrow and a vertical scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the size of the arrow." -} -msg.pack('side'=>'top', 'padx'=>'.5c') - -TkFrame.new($vscale_demo) {|frame| - TkButton.new(frame) { - text 'Dismiss' - command proc { - tmppath = $vscale_demo - $vscale_demo = nil - tmppath.destroy - } - }.pack('side'=>'left', 'expand'=>'yes') - - TkButton.new(frame) { - text 'Show Code' - command proc { showCode 'vscale' } - }.pack('side'=>'left', 'expand'=>'yes') -}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') - -TkFrame.new($vscale_demo) {|frame| - borderwidth 10 - canvas = TkCanvas.new(frame) {|c| - width 50 - height 50 - bd 0 - highlightthickness 0 - TkcPolygon.new(c, 0, 0, 1, 1, 2, 2) { - fill 'SeaGreen3' - tags 'poly' - } - TkcLine.new(c, 0, 0, 1, 1, 2, 2, 0, 0) { - fill 'black' - tags 'line' - } - }.pack('side'=>'left', 'anchor'=>'nw', 'fill'=>'y') - scale = TkScale.new(frame) { - orient 'vertical' - length 284 - from 0 - to 250 - command proc{|value| setHeight(canvas, value)} - tickinterval 50 - }.pack('side'=>'left', 'anchor'=>'ne') - scale.set 75 -}.pack - - -def setHeight(w, height) - height = height + 21 - y2 = height - 30 - if y2 < 21 - y2 = 21 - end - w.coords 'poly',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 - w.coords 'line',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20 -end |