examples & tests: update users of the gtk module
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 5 May 2015 10:08:45 +0000 (06:08 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 6 May 2015 17:44:54 +0000 (13:44 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

examples/calculator/Makefile
examples/calculator/src/calculator_gtk.nit
tests/test_gtk.nit

index 6f9a0a3..dd66960 100644 (file)
@@ -1,8 +1,7 @@
 all:
        mkdir -p bin/
 
-       # Compile in global mode to silence warnings on unused GTK deprecated
-       ../../bin/nitc --global --dir bin/ src/calculator_gtk.nit src/calculator_test.nit
+       ../../bin/nitc --dir bin/ src/calculator_gtk.nit src/calculator_test.nit
 
 android:
        mkdir -p bin/ res/
index bd01986..7586230 100644 (file)
@@ -55,10 +55,11 @@ class CalculatorGui
        do
                init_gtk
 
-               win = new GtkWindow(0)
+               win = new GtkWindow(new GtkWindowType.toplevel)
+               win.connect_destroy_signal_to_quit
 
-               container = new GtkGrid(5, 5, true)
-               win.add(container)
+               container = new GtkGrid
+               win.add container
 
                lbl_disp = new GtkLabel("_")
                container.attach(lbl_disp, 0, 0, 5, 1)
index 510b5fb..4916f4b 100644 (file)
@@ -47,9 +47,10 @@ class MyApp
        do
                init_gtk
 
-               win = new GtkWindow( 0 )
+               win = new GtkWindow(new GtkWindowType.toplevel)
+               win.connect_destroy_signal_to_quit
 
-               container = new GtkGrid(2,1,true)
+               container = new GtkGrid
                win.add( container )
 
                lbl = new GtkLabel( "Hello world" )