Skip to content

Instantly share code, notes, and snippets.

@levi730
Created July 15, 2011 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save levi730/1084006 to your computer and use it in GitHub Desktop.
Save levi730/1084006 to your computer and use it in GitHub Desktop.
how to do subwindow with nav using struct
/**
* Appcelerator Titanium Platform
* Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
**/
// Code is stripped-down version of Tweetanium, to expose new structure paradigm
(function(){
S.ui.createFooWin = function(){
var win = Ti.UI.createWindow({backgroundColor: "red",title:"foo"});
win.add(Ti.UI.createLabel(S.combine({text: "See blogpost @ http://blog.krawaller.se"},$$.Label)));
var button = Titanium.UI.createButton({
title: 'Hello',
height: '20px'
});
button.addEventListener('click',function(e)
{
subwin = S.ui.createsubwin();
subwin.open();
});
win.add(button);
return win;
};
S.ui.createsubwin = function(){
var win = Ti.UI.createWindow({backgroundColor: "red",title:"test sub"});
win.add(Ti.UI.createLabel(S.combine({text: "Subwin test."},$$.Label)));
return win;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment