From 80bb7eef8610fc663d2ef2b166560e3dc7a4c87a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 6 Sep 2017 11:51:00 -0400 Subject: [PATCH] app: update clients to use `root_window` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- contrib/benitlux/src/client/views/home_views.nit | 19 ++----------------- contrib/tnitter/src/tnitter_app.nit | 15 ++------------- examples/calculator/src/calculator.nit | 11 +---------- 3 files changed, 5 insertions(+), 40 deletions(-) diff --git a/contrib/benitlux/src/client/views/home_views.nit b/contrib/benitlux/src/client/views/home_views.nit index 402c173..460e1be 100644 --- a/contrib/benitlux/src/client/views/home_views.nit +++ b/contrib/benitlux/src/client/views/home_views.nit @@ -19,24 +19,9 @@ import beer_views import social_views import user_views -redef class App - redef fun on_create - do - if debug then print "App::on_create" - - # Create the main window - show_home - super - end - - # Show the home/main windows - fun show_home - do - var window = new HomeWindow - window.refresh - push_window window - end +redef fun root_window do return new HomeWindow +redef class App redef fun on_log_in do super diff --git a/contrib/tnitter/src/tnitter_app.nit b/contrib/tnitter/src/tnitter_app.nit index 8218004..760af3d 100644 --- a/contrib/tnitter/src/tnitter_app.nit +++ b/contrib/tnitter/src/tnitter_app.nit @@ -38,18 +38,7 @@ import model # Delay in seconds before the next request after an error fun request_delay_on_error: Float do return 60.0 -redef class App - redef fun on_create - do - # Create the main window - push_window new TnitterWindow - super - end -end - -# Main window -class TnitterWindow - super Window +redef class Window private var layout = new VerticalLayout(parent=self) private var list_posts = new ListLayout(parent=layout) @@ -98,7 +87,7 @@ fun tnitter_server_uri: String do return "http://localhost:8080" abstract class AsyncTnitterRequest super AsyncHttpRequest - private var window: TnitterWindow + private var window: Window redef fun uri_root do return tnitter_server_uri diff --git a/examples/calculator/src/calculator.nit b/examples/calculator/src/calculator.nit index 6cfb1aa..32799ca 100644 --- a/examples/calculator/src/calculator.nit +++ b/examples/calculator/src/calculator.nit @@ -32,16 +32,7 @@ import calculator_logic # Show debug output? fun debug: Bool do return false -redef class App - redef fun on_create - do - if debug then print "App::on_create" - - # Create the main window - push_window new CalculatorWindow - super - end -end +redef fun root_window do return new CalculatorWindow # The main (and only) window of this calculator class CalculatorWindow -- 1.7.9.5