All pastes #925250 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-02 05:07 UTC
rendered paste body
// test.myapp.test101
// /Applications/Test101.app/main.js
Plugins.load( "UIKit" );

var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
window.setHidden( false );
window.orderFront();
window.makeKey();
window.backgroundColor = [ 1 , 1 , 1 , 1 ];

var mainView = new UIView();
window.setContentView( mainView );

var save = new UIPushButton( [ 20 , 351 , window.bounds[2]-40 , 40 ] );
mainView.addSubview( save );

var bar = new UINavigationBar( [ 0 , 0 , window.bounds[ 2 ] , 48 ] );
bar.showButtonsWithLeftTitle( "Save File" , "Open File" , false );
mainView.addSubview( bar );

var itemOne = new UINavigationItem( "Text Editor" );
bar.pushNavigationItem( itemOne );

var textField = new UITextField( [ 20 , 52 , window.bounds[2]-40 , 40 ] );
textField.setBorderStyle( 1 );
textField.placeholder = "Type A File Name Here";
mainView.addSubview( textField );

var input = new UITextView( [ 20 , 92 , window.bounds[ 2 ] - 40 , 195 ] );
input.editable = true;
input.color = [ 0 , 0 , 0 , .75 ];
input.text = "Tap To Start Typing!";
input.backgroundColor = [ 0 , 0 , 0 , .15 ];
input.visibleRect = true;
mainView.addSubview( input );

var keyboard = new UIKeyboard();
keyboard.preferredKeyboardType = 0;
keyboard.setDefaultReturnKeyType( 0 );
keyboard.showPreferredLayout();
keyboard.activate();
mainView.addSubview( keyboard );