From c014e35aecd831001b1f1e1fec4a53b61db1d664 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sun, 12 Jan 2014 19:52:30 +0000 Subject: [PATCH] Add ability to clear screen.window, and use it. --- Nasal/screen.nas | 5 +++++ Nasal/tutorial/tutorial.nas | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Nasal/screen.nas b/Nasal/screen.nas index 496a45474..1fbdc3683 100644 --- a/Nasal/screen.nas +++ b/Nasal/screen.nas @@ -116,6 +116,11 @@ var window = { settimer(func { me._write_(); } , 0, 1); append(me.writebuffer, lines); }, + clear : func() { + me.lines = []; + me.writebuffer = []; + me.show(); + }, show : func { if (me.dialog != nil) me.close(); diff --git a/Nasal/tutorial/tutorial.nas b/Nasal/tutorial/tutorial.nas index d6ab8b953..4c50659b8 100644 --- a/Nasal/tutorial/tutorial.nas +++ b/Nasal/tutorial/tutorial.nas @@ -105,6 +105,7 @@ var startTutorial = func { # do_group(tutorialN.getNode("init")); is_running(1); # needs to be after "presets-commit" + display.clear(); display.show(); # Pick up any weather conditions/scenarios set @@ -121,6 +122,7 @@ var stopTutorial = func { set_properties(end); run_nasal(end); set_view(end) or view.point.restore(); + say("Tutorial finished."); settimer(func() { if (!is_running()) { display.close(); } }, 10); } set_marker(); @@ -150,8 +152,6 @@ var step_tutorial = func(id) { # if (current_step >= size(steps)) { var end = tutorialN.getNode("end"); - say_message(end, "Tutorial finished."); - #say_message(nil, "Deviations: " ~ num_errors); stopTutorial(); return; }