examples: update mnit_simple to android.nit
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 31 May 2014 19:04:08 +0000 (15:04 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 5 Jun 2014 15:13:05 +0000 (11:13 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

examples/mnit_simple/src/simple.nit
examples/mnit_simple/src/simple_android.nit
lib/mnit_linux/linux_app.nit

index 2b45b1c..dd6f65d 100644 (file)
@@ -22,14 +22,11 @@ end
 
 import mnit
 
-class MyApp
-       super App
+redef class App
 
        var img : nullable I = null
 
-       init do super
-
-       redef fun init_window
+       redef fun window_created
        do
                super
 
@@ -73,7 +70,3 @@ class MyApp
                end
        end
 end
-
-var app = new MyApp
-app.main_loop
-
index fe05f36..157bc7e 100644 (file)
@@ -27,7 +27,7 @@ in "Java" `{
        import android.widget.Toast;
 `}
 
-redef class MyApp
+redef class App
        redef fun input( ie )
        do
                if ie isa PointerEvent and ie.depressed then do_java_stuff
@@ -41,7 +41,7 @@ redef class MyApp
 
                // - Context needed from now on
                // NativeActivity is a Java sub-class of Context
-               final android.app.NativeActivity context = MyApp_native_activity(recv);
+               final android.app.NativeActivity context = App_native_activity(recv);
 
                // Vibration
                android.os.Vibrator v = (android.os.Vibrator)
index edbede5..5534d5a 100644 (file)
@@ -35,7 +35,7 @@ redef class App
 
                super
 
-               init_window
+               window_created
        end
 
        redef fun generate_input