Skip to content

Instantly share code, notes, and snippets.

@poutyface
Created January 26, 2012 04:37

Revisions

  1. poutyface renamed this gist Jan 26, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. poutyface revised this gist Jan 26, 2012. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,23 @@
    //
    // Window
    //

    // create window
    var win = Ti.UI.createWindow({
    title:'window',
    backgroundColor:'#fff'
    });

    // get current window
    win = Ti.UI.currentWindow;

    // open window
    win.open();
    // Using Tab, this is a smart way
    Ti.UI.currentTab.open(win);

    // close window
    win.close();

    //
    // Tab
  3. poutyface revised this gist Jan 26, 2012. 1 changed file with 37 additions and 0 deletions.
    37 changes: 37 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -44,3 +44,40 @@ var tableView = Ti.UI.createTableView({

    currentData = [];
    tableView.setData(currentData);


    //
    // Button
    //
    var button = Ti.UI.createButton({
    top: 160,
    left: 100,
    width: 80,
    height: 44,
    title: 'button'
    });


    //
    // OptionDialog
    //
    var optionDialog = Ti.UI.createOptionDialog({
    options: ['option1', 'option2', 'cancel'],
    cancel: 2,
    title: 'option dialog'
    });

    optionDialog.addEventListener('click', function(e){
    switch(e.index){
    case 0:
    // option1();
    break;
    case 1:
    // option2();
    break;
    }
    });

    button.addEventListener('click', function(e){
    optionDialog.show();
    });
  4. poutyface revised this gist Jan 26, 2012. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -34,3 +34,13 @@ var Label = Ti.UI.createLabel({
    color: '#2b4771'
    });


    //
    // TableView
    //
    var tableView = Ti.UI.createTableView({
    data:[]
    });

    currentData = [];
    tableView.setData(currentData);
  5. poutyface revised this gist Jan 26, 2012. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,6 @@ var win = Ti.UI.createWindow({
    var tabGroup = Ti.UI.createTabGroup();

    var tab = Ti.UI.createTab({
    icon:'KS_nav_views.png',
    title:'Tab',
    window:win
    });
  6. poutyface revised this gist Jan 26, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -25,8 +25,7 @@ tabGroup.open();
    //
    // Label
    //
    var Label = Ti.UI.createLabel(
    {
    var Label = Ti.UI.createLabel({
    width: 120,
    height: 12,
    left: 58,
  7. poutyface revised this gist Jan 26, 2012. 1 changed file with 20 additions and 4 deletions.
    24 changes: 20 additions & 4 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    //
    // Window
    //
    var win = Titanium.UI.createWindow({
    var win = Ti.UI.createWindow({
    title:'window',
    backgroundColor:'#fff'
    });
    @@ -10,13 +10,29 @@ var win = Titanium.UI.createWindow({
    //
    // Tab
    //
    var tabGroup = Titanium.UI.createTabGroup();
    var tabGroup = Ti.UI.createTabGroup();

    var tab = Titanium.UI.createTab({
    var tab = Ti.UI.createTab({
    icon:'KS_nav_views.png',
    title:'Tab',
    window:win
    });

    tabGroup.addTab(tab);
    tabGroup.open();
    tabGroup.open();


    //
    // Label
    //
    var Label = Ti.UI.createLabel(
    {
    width: 120,
    height: 12,
    left: 58,
    top: 5,
    fontSize: 6,
    fontWeight: 'bold',
    color: '#2b4771'
    });

  8. poutyface created this gist Jan 26, 2012.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    //
    // Window
    //
    var win = Titanium.UI.createWindow({
    title:'window',
    backgroundColor:'#fff'
    });


    //
    // Tab
    //
    var tabGroup = Titanium.UI.createTabGroup();

    var tab = Titanium.UI.createTab({
    icon:'KS_nav_views.png',
    title:'Tab',
    window:win
    });

    tabGroup.addTab(tab);
    tabGroup.open();