diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/tile/tnotebook.rb')
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tnotebook.rb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb index 76f225c579..4d65e363da 100644 --- a/ext/tk/lib/tkextlib/tile/tnotebook.rb +++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb @@ -41,13 +41,35 @@ class Tk::Tile::TNotebook < TkWindow private :__item_methodcall_optkeys #alias tabcget itemcget + #alias tabcget_strict itemcget_strict alias tabconfigure itemconfigure alias tabconfiginfo itemconfiginfo alias current_tabconfiginfo current_itemconfiginfo - def tabcget(tagOrId, option) + def tabcget_strict(tagOrId, option) tabconfigure(tagOrId, option)[-1] end + def tabcget(tagOrId, option) + unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ + tabcget_strict(tagOrId, option) + else + begin + tabcget_strict(tagOrId, option) + rescue => e + begin + if current_tabconfiginfo(tagOrId).has_key?(option.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 ################################ include Tk::Tile::TileWidget @@ -77,9 +99,9 @@ class Tk::Tile::TNotebook < TkWindow def add(child, keys=nil) if keys && keys != None - tk_send_without_enc('add', _epath(child), *hash_kv(keys)) + tk_send('add', _epath(child), *hash_kv(keys)) else - tk_send_without_enc('add', _epath(child)) + tk_send('add', _epath(child)) end self end |