File tree 2 files changed +53
-24
lines changed
2 files changed +53
-24
lines changed Original file line number Diff line number Diff line change @@ -15,33 +15,15 @@ class _Main {
15
15
16
16
class MyApp extends ui . Application {
17
17
function constructor ( ) {
18
- var top = new ui . TabBarController ( ) ;
19
-
20
- var firstTab = new FirstViewController ( ) ;
21
- var secondTab = new SecondViewController ( ) ;
22
-
23
- top . setViewControllers ( [ firstTab , secondTab ] : ui . ViewController [ ] ) ;
24
-
18
+ var top = new ui . ViewController ( ) ;
25
19
this . setRootViewController ( top ) ;
26
- }
27
- }
28
-
29
- class FirstViewController extends ui . ViewController {
30
- function constructor ( ) {
31
- this . setTabBarItem ( new ui . TabBarItem ( "first" ) ) ;
32
20
33
21
var view = new ui . View ( ) ;
34
- view . setBackgroundColor ( ui . Color . GREEN ) ;
35
- this . setView ( view ) ;
36
- }
37
- }
38
-
39
- class SecondViewController extends ui . ViewController {
40
- function constructor ( ) {
41
- this . setTabBarItem ( new ui . TabBarItem ( "second" ) ) ;
22
+ top . setView ( view ) ;
42
23
43
- var view = new ui . View ( ) ;
44
- view . setBackgroundColor ( ui . Color . BLUE ) ;
45
- this . setView ( view ) ;
24
+ view . addSubview ( new ui . Label ( "first" ) ) ;
25
+ view . addSubview ( new ui . Label ( "second" ) ) ;
26
+ view . addSubview ( new ui . Label ( "third" ) ) ;
46
27
}
47
28
}
29
+
Original file line number Diff line number Diff line change
1
+ import "../lib/ui/*.jsx" into ui ;
2
+ import "js/web.jsx" ;
3
+ import "console.jsx" ;
4
+
5
+ class _Main {
6
+ static function main ( args : string [ ] ) : void {
7
+ console . time ( "application loading" ) ;
8
+
9
+ var app = new MyApp ( ) ;
10
+ app . attach ( dom . id ( "world" ) ) ;
11
+
12
+ console . timeEnd ( "application loading" ) ;
13
+ }
14
+ }
15
+
16
+ class MyApp extends ui . Application {
17
+ function constructor ( ) {
18
+ var top = new ui . TabBarController ( ) ;
19
+
20
+ var firstTab = new FirstViewController ( ) ;
21
+ var secondTab = new SecondViewController ( ) ;
22
+
23
+ top . setViewControllers ( [ firstTab , secondTab ] : ui . ViewController [ ] ) ;
24
+
25
+ this . setRootViewController ( top ) ;
26
+ }
27
+ }
28
+
29
+ class FirstViewController extends ui . ViewController {
30
+ function constructor ( ) {
31
+ this . setTabBarItem ( new ui . TabBarItem ( "first" ) ) ;
32
+
33
+ var view = new ui . View ( ) ;
34
+ view . setBackgroundColor ( ui . Color . GREEN ) ;
35
+ this . setView ( view ) ;
36
+ }
37
+ }
38
+
39
+ class SecondViewController extends ui . ViewController {
40
+ function constructor ( ) {
41
+ this . setTabBarItem ( new ui . TabBarItem ( "second" ) ) ;
42
+
43
+ var view = new ui . View ( ) ;
44
+ view . setBackgroundColor ( ui . Color . BLUE ) ;
45
+ this . setView ( view ) ;
46
+ }
47
+ }
You can’t perform that action at this time.
0 commit comments