summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkpalette.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-01 16:09:54 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-01 16:09:54 +0000
commit4c4631c2daaf7b2418c1f0e39292c8ee27a64813 (patch)
treedfeb96c4772df8caba4e01e749c8f3e1262f8fe0 /ext/tk/lib/tkpalette.rb
parentce23680755e4e9ab0eed9dc6adb091ef7f1c58cb (diff)
* renewal Ruby/Tk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkpalette.rb')
-rw-r--r--ext/tk/lib/tkpalette.rb54
1 files changed, 2 insertions, 52 deletions
diff --git a/ext/tk/lib/tkpalette.rb b/ext/tk/lib/tkpalette.rb
index dc2fd47e5c..56b203bbb9 100644
--- a/ext/tk/lib/tkpalette.rb
+++ b/ext/tk/lib/tkpalette.rb
@@ -1,54 +1,4 @@
#
-# tkpalette.rb : methods for Tcl/Tk standard library 'palette.tcl'
-# 1998/06/21 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+# tkpalette.rb - load tk/palette.rb
#
-require 'tk'
-
-module TkPalette
- include Tk
- extend Tk
-
- TkCommandNames = [
- 'tk_setPalette'.freeze,
- 'tk_bisque'.freeze,
- 'tkDarken'.freeze
- ].freeze
-
- def TkPalette.set(*args)
- args = args.to_a.flatten if args.kind_of? Hash
- tk_call 'tk_setPalette', *args
- end
- def TkPalette.setPalette(*args)
- TkPalette.set(*args)
- end
-
- def TkPalette.bisque
- tk_call 'tk_bisque'
- end
-
- def TkPalette.darken(color, percent)
- tk_call 'tkDarken', color, percent
- end
-
- def TkPalette.recolorTree(window, colors)
- if not colors.kind_of?(Hash)
- fail "2nd arg need to be Hash"
- end
-
- colors.each{|key, value|
- begin
- if window.cget(key) == tk_call('set', "tkPalette(#{key})")
- window[key] = colors[key]
- end
- rescue
- # ignore
- end
- }
-
- TkWinfo.children(window).each{|w| TkPalette.recolorTree(w, colors)}
- end
-
- def recolorTree(colors)
- TkPalette.recolorTree(self, colors)
- end
-end
+require 'tk/palette'