diff options
Diffstat (limited to 'ext/tk/lib/tk/scale.rb')
-rw-r--r-- | ext/tk/lib/tk/scale.rb | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb index b97ed68072..bf2791ec55 100644 --- a/ext/tk/lib/tk/scale.rb +++ b/ext/tk/lib/tk/scale.rb @@ -14,9 +14,24 @@ class Tk::Scale<TkWindow cmd = keys.delete('command') keys['command'] = proc{|val| cmd.call(val.to_f)} end - #tk_call_without_enc('scale', @path, *hash_kv(keys, true)) - tk_call_without_enc(self.class::TkCommandNames[0], @path, - *hash_kv(keys, true)) + unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ + #tk_call_without_enc('scale', @path, *hash_kv(keys, true)) + tk_call_without_enc(self.class::TkCommandNames[0], @path, + *hash_kv(keys, true)) + else + begin + tk_call_without_enc(self.class::TkCommandNames[0], @path, + *hash_kv(keys, true)) + rescue + tk_call_without_enc(self.class::TkCommandNames[0], @path) + keys = __check_available_configure_options(keys) + unless keys.empty? + tk_call_without_enc('destroy', @path) + tk_call_without_enc(self.class::TkCommandNames[0], @path, + *hash_kv(keys, true)) + end + end + end else #tk_call_without_enc('scale', @path) tk_call_without_enc(self.class::TkCommandNames[0], @path) |