summaryrefslogtreecommitdiff
path: root/ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 15:59:18 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 15:59:18 +0000
commit72113d58cd2fc62b3f4ef3d2eb6cec37393532a4 (patch)
tree534843caaea28f1171378c1ac5bea0184ed04054 /ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb
parent1a74fa4b04da04bd2bb33103dd3cf431438df38e (diff)
parent02b8978ff10b05304dbb46d73b49a2cf3a87cb92 (diff)
add tag v2_2_9v2_2_9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_2_9@61259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb')
-rw-r--r--ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb60
1 files changed, 0 insertions, 60 deletions
diff --git a/ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb b/ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb
deleted file mode 100644
index dddbb776dc..0000000000
--- a/ruby_2_2/ext/tk/sample/tkextlib/tktable/basic.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env ruby
-##
-## basic.rb
-##
-## This demo shows the basic use of the table widget
-##
-## ( based on 'basic.tcl' included source archive of tktable extension )
-##
-require 'tk'
-require 'tkextlib/tktable'
-
-ary = TkVariable.new_hash
-rows = 8
-cols = 8
-
-# fill table variable
-((-(rows))..rows).each{|x|
- ((-(cols))..cols).each{|y|
- ary[x,y] = "r#{x},c#{y}"
- }
-}
-
-lbl = TkLabel.new(:text=>"TkTable v1 Example")
-
-table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary,
- :width=>6, :height=>6,
- :titlerows=>1, :titlecols=>2,
- :roworigin=>-1, :colorigin=>-2,
- :rowstretchmode=>:last, :colstretchmode=>:last,
- :rowtagcommand=>proc{|row|
- row = Integer(row)
- (row>0 && row%2 == 1)? 'OddRow': ''
- },
- :coltagcommand=>proc{|col|
- col = Integer(col)
- (col>0 && col%2 == 1)? 'OddCol': ''
- },
- :selectmode=>:extended, :sparsearray=>false)
-
-sx = table.xscrollbar(TkScrollbar.new)
-sy = table.yscrollbar(TkScrollbar.new)
-
-btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
-
-Tk.grid(lbl, '-', :sticky=>:ew)
-Tk.grid(table, sy, :sticky=>:news)
-Tk.grid(sx, :sticky=>:ew)
-Tk.grid(btn, :sticky=>:ew, :columnspan=>2)
-
-Tk.root.grid_columnconfig(0, :weight=>1)
-Tk.root.grid_rowconfig(1, :weight=>1)
-
-table.tag_configure('OddRow', :bg=>'orange', :fg=>'purple')
-table.tag_configure('OddCol', :bg=>'brown', :fg=>'pink')
-
-table.set_width([-2, 7], [-1, 7], [1, 5], [2, 8], [4, 14])
-
-puts "Table is #{table.path} with array #{(table['variable'])}"
-
-Tk.mainloop