Okay, so I see that items are added in reverse order ? You add the button first, and the tab page it goes onto last ?
If so it seems to me that in the button the from_pane="0"to_pane="0" bit determines that the button should appear on the tab page with index 0 (i.e. the first one)
What I wonder about, is that a button is an item with a clear declaration (type="4"uid="Item_8"). Why do you not need to declare the tab page type ?
Is this an implicit thing, i.e. if you don't determine the type it becomes a panel / tab page ?
If that is so, can you explicitly determine a panel / tab page ?