diff options
Diffstat (limited to 'ext/tk/lib/tk/image.rb')
-rw-r--r-- | ext/tk/lib/tk/image.rb | 19 |
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 |