Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created June 3, 2011 15:58
Show Gist options
  • Select an option

  • Save jonalter/1006581 to your computer and use it in GitHub Desktop.

Select an option

Save jonalter/1006581 to your computer and use it in GitHub Desktop.
TabGroup window blur and focus
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
backgroundColor: 'blue'
});
win1.addEventListener('blur', function(e){
Ti.API.info('blur');
});
win1.addEventListener('focus', function(e){
Ti.API.info('focus');
});
var openButton = Ti.UI.createButton({
title:'open',
height: 50,
width: 200
});
win1.add(openButton);
openButton.addEventListener('click', function(e){
var win2 = Ti.UI.createWindow({
backgroundColor: 'red'
});
var closeButton = Ti.UI.createButton({
title: 'close',
height: 50,
width: 200
});
closeButton.addEventListener('click', function(e){
win2.close();
})
win2.add(closeButton);
tab1.open(win2);
});
var tab1 = Ti.UI.createTab({
window: win1
});
tabGroup.addTab(tab1);
tabGroup.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment