

def _list_from_layouttuple(tk, ltuple):
    'Construct a list from the tuple returned by ttk::layout, this is\n    somewhat the reverse of _format_layoutlist.'
    ltuple = tk.splitlist(ltuple)
    res = []
    indx = 0
    while (indx < len(ltuple)):
        name = ltuple[indx]
        opts = {
            
        }
        res.append((name, opts))
        indx += 1
        while (indx < len(ltuple)):
            (opt, val) = ltuple[indx:(indx + 2)]
            if (not opt.startswith('-')):
                break
            opt = opt[1:]
            indx += 2
            if (opt == 'children'):
                val = _list_from_layouttuple(tk, val)
            opts[opt] = val
    return res

dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/lib-tk/ttk.py _list_from_layouttuple/original