diff options
Diffstat (limited to 'ext/tk/lib/tk/pack.rb')
-rw-r--r-- | ext/tk/lib/tk/pack.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/pack.rb b/ext/tk/lib/tk/pack.rb index 8fab363121..220a38e524 100644 --- a/ext/tk/lib/tk/pack.rb +++ b/ext/tk/lib/tk/pack.rb @@ -9,6 +9,7 @@ module TkPack TkCommandNames = ['pack'.freeze].freeze +=begin def configure(win, *args) if args[-1].kind_of?(Hash) opts = args.pop @@ -29,6 +30,22 @@ module TkPack } tk_call_without_enc("pack", 'configure', *params) end +=end + def configure(*args) + if args[-1].kind_of?(Hash) + opts = args.pop + else + opts = {} + end + fail ArgumentError, 'no widget is given' if args.empty? + params = [] + args.flatten(1).each{|win| params.push(_epath(win))} + opts.each{|k, v| + params.push("-#{k}") + params.push(_epath(v)) # have to use 'epath' (hash_kv() is unavailable) + } + tk_call_without_enc("pack", 'configure', *params) + end alias pack configure def forget(*args) |