summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/image.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-23 05:22:13 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-23 05:22:13 +0000
commit61a68941b1d22973dfb832e0575596d53f3e31b4 (patch)
treead2e6871fc4bd6e4bfbfe2aa71b888e51a4b2261 /ext/tk/lib/tk/image.rb
parent280f8df3706176fac38ef42e3fc79d30ac6e1e16 (diff)
Merge from ruby_1_8. Add files that have not been added yet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/image.rb')
-rw-r--r--ext/tk/lib/tk/image.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb
index 57f82cb812..dffdc19644 100644
--- a/ext/tk/lib/tk/image.rb
+++ b/ext/tk/lib/tk/image.rb
@@ -156,7 +156,7 @@ class TkPhotoImage<TkImage
self
end
- def cget(option)
+ def cget_strict(option)
case option.to_s
when 'data', 'file'
tk_send 'cget', '-' << option.to_s
@@ -164,6 +164,23 @@ class TkPhotoImage<TkImage
tk_tcl2ruby(tk_send('cget', '-' << option.to_s))
end
end
+ def cget(option)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ cget_strict(option)
+ else
+ begin
+ cget_strict(option)
+ rescue => e
+ if current_configinfo.has_key?(option.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ end
+ end
+ end
def copy(src, *opts)
if opts.size == 0