begin¶ ↑
def initialize(parent, type=None)
widgetname = nil
if parent.kind_of? Hash
keys = _symbolkey2str(parent)
parent = keys.delete('parent')
widgetname = keys.delete('widgetname')
type = keys.delete('type'); type = None unless type
end
@parent = parent
install_win(@parent.path, widgetname)
tk_call_without_enc(@parent.path, 'clone', @path, type)
end
def initialize(src_menu, *args)
widgetname = nil
if args[0].kind_of?(TkWindow)
parent = args.shift
else
parent = src_menu
end
if args[0].kind_of?(String) || args[0].kind_of?(Symbol)
type = args.shift
else
type = None
end
if args[0].kind_of?(Hash)
keys = _symbolkey2str(args.shift)
parent = keys.delete('parent') if keys.has_key?('parent')
widgetname = keys.delete('widgetname')
type = keys.delete('type') if keys.has_key?('type')
else
keys = nil
end
@src_menu = src_menu
@parent = parent
@type = type
install_win(@parent.path, widgetname)
tk_call_without_enc(@src_menu.path, 'clone', @path, @type)
configure(keys) if keys && !keys.empty?
end