Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created March 18, 2011 19:15
Show Gist options
  • Save jonalter/876662 to your computer and use it in GitHub Desktop.
Save jonalter/876662 to your computer and use it in GitHub Desktop.
TabGroup in a TabGroup
var tabGroupOuter = Ti.UI.createTabGroup();
tabGroupOuter.addTab(Ti.UI.createTab({
title: 'app.js',
window: Ti.UI.createWindow({
title: 'app.js',
url: 'middle.js',
backgroundColor: 'red'
})
}));
tabGroupOuter.open();
var containingWindow = Ti.UI.currentWindow;
var tabGroupInner = Ti.UI.createTabGroup();
tabGroupInner.addTab(Ti.UI.createTab({
window: Ti.UI.createWindow({
backgroundColor: 'blue'
})
}));
tabGroupInner.open();
var currentTab = Ti.UI.currentTab;
var button = Ti.UI.createButton({ title: 'open inner tab group' });
button.addEventListener('click', function() {
var win = Ti.UI.createWindow({
url: 'inner.js',
title: 'inner.js'
});
currentTab.open(win);
});
Ti.UI.currentWindow.add(button);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment