From 61a68941b1d22973dfb832e0575596d53f3e31b4 Mon Sep 17 00:00:00 2001 From: knu Date: Fri, 23 May 2008 05:22:13 +0000 Subject: 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 --- ext/tk/lib/tkextlib/tile/tpaned.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'ext/tk/lib/tkextlib/tile/tpaned.rb') diff --git a/ext/tk/lib/tkextlib/tile/tpaned.rb b/ext/tk/lib/tkextlib/tile/tpaned.rb index f24b12e92e..d96ff43973 100644 --- a/ext/tk/lib/tkextlib/tile/tpaned.rb +++ b/ext/tk/lib/tkextlib/tile/tpaned.rb @@ -66,10 +66,33 @@ class Tk::Tile::TPaned < TkWindow self end - def panecget(pane, slot) + def panecget_strict(pane, slot) pane = _epath(pane) tk_tcl2ruby(tk_send_without_enc('pane', pane, "-#{slot}")) end + alias pane_cget_strict panecget_strict + + def panecget(pane, slot) + unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ + panecget_strict(pane, slot) + else + begin + panecget_strict(pane, slot) + rescue => e + begin + if current_paneconfiginfo(pane).has_key?(slot.to_s) + # not tag error & option is known -> error on known option + fail e + else + # not tag error & option is unknown + nil + end + rescue + fail e # tag error + end + end + end + end alias pane_cget panecget def paneconfigure(pane, key, value=nil) -- cgit v1.2.3