There will always be the main and secondary splitters. They should never be removed. The secondary splitter is contained in the main one. Once I realized that, things got much clearer. Any of Leo's standard frames - body editor, tree, log - can be placed into any splitter, and any of the splitters can be set for vertical or horizontal orientation independent of the others. To change a layout, reparent all known widgets to their new targets (inserting each according to its prescribed index), delete other added widgets from their containers, then delete no-longer-used splitters.
"- Don't use settings to modify layouts." Yes, but settings *can* be used to create new layout script commands.
Here is an example of a layout description that can be instantiated by a script. It uses composable sublayouts:
SUBLAYOUTS
---------------------
MAIN_SPLITTER = {'name': 'main_splitter', 'orientation': 'horizontal',
'children': ((1, 'secondary_splitter'), (2, 'bodyFrame'))}
SECONDARY_SPLITTER = {'name': 'secondary_splitter', 'orientation': 'vertical',
'children': ((1, 'outlineFrame'), (2, 'logFrame'))}
Known Splitter Name Sequence (used to remove unwanted splitters)
-----------------------------------------------------
BASE_SPLITTERS = ('main_splitter', 'secondary_splitter')
Overall Sequence Of SUBLAYOUTS
-------------------------------
BASE_LAYOUT = (MAIN_SPLITTER, SECONDARY_SPLITTER)
A Complete Layout
------------------
LAYOUT = {'sub_layouts': BASE_LAYOUT, 'known_splitters': BASE_SPLITTERS}