From 309886cd1df82f54a00fb5cd04995c2d2f858db9 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@uliege.be>
Date: Wed, 25 Mar 2020 23:08:57 +0100
Subject: [PATCH] small fixes

---
 tutorial/c++/README.txt | 4 ++--
 tutorial/c++/t1.cpp     | 3 +++
 tutorial/c++/t14.cpp    | 1 -
 tutorial/c++/t7.cpp     | 3 ---
 tutorial/c++/t9.cpp     | 3 ---
 tutorial/python/t1.py   | 3 +++
 tutorial/python/t17.py  | 4 ++--
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tutorial/c++/README.txt b/tutorial/c++/README.txt
index 6289d492fb..d0a158c690 100644
--- a/tutorial/c++/README.txt
+++ b/tutorial/c++/README.txt
@@ -1,5 +1,5 @@
-This directory contains C++ versions of some of the tutorials, written using
-the Gmsh API.
+This directory contains C++ versions of the tutorials, written using the Gmsh
+API.
 
 To compile and run the C++ tutorials, you need the Gmsh dynamic library and the
 associated header file (`gmsh.h'). These can be either obtained
diff --git a/tutorial/c++/t1.cpp b/tutorial/c++/t1.cpp
index ec868d5bbd..987cf2a105 100644
--- a/tutorial/c++/t1.cpp
+++ b/tutorial/c++/t1.cpp
@@ -85,6 +85,9 @@ int main(int argc, char **argv)
   //
   // gmsh::option::setNumber("Mesh.SaveAll", 1);
 
+  // We could run the graphical user interface with
+  // gmsh::fltk::run();
+
   // This should be called at the end:
   gmsh::finalize();
   return 0;
diff --git a/tutorial/c++/t14.cpp b/tutorial/c++/t14.cpp
index 97fab96bcc..b4d676b30b 100644
--- a/tutorial/c++/t14.cpp
+++ b/tutorial/c++/t14.cpp
@@ -128,7 +128,6 @@ int main(int argc, char **argv)
   // Generate the mesh and perform the requested homology computations
   gmsh::model::mesh::generate(3);
 
-  gmsh::fltk::run();
   gmsh::finalize();
   return 0;
 }
diff --git a/tutorial/c++/t7.cpp b/tutorial/c++/t7.cpp
index cb3c747fdc..e337db595b 100644
--- a/tutorial/c++/t7.cpp
+++ b/tutorial/c++/t7.cpp
@@ -45,9 +45,6 @@ int main(int argc, char **argv)
   model::mesh::generate(2);
   gmsh::write("t7.msh");
 
-  // show the mesh file
-  gmsh::fltk::run();
-
   gmsh::finalize();
   return 0;
 }
diff --git a/tutorial/c++/t9.cpp b/tutorial/c++/t9.cpp
index 076cabe552..00ed8f88c8 100644
--- a/tutorial/c++/t9.cpp
+++ b/tutorial/c++/t9.cpp
@@ -57,9 +57,6 @@ int main(int argc, char **argv)
   gmsh::option::setNumber("View[1].IntervalsType", 2);
   gmsh::option::setNumber("View[2].IntervalsType", 2);
 
-  // show the GUI at the end
-  gmsh::fltk::run();
-
   gmsh::finalize();
   return 0;
 }
diff --git a/tutorial/python/t1.py b/tutorial/python/t1.py
index 6db096540b..619478b58a 100644
--- a/tutorial/python/t1.py
+++ b/tutorial/python/t1.py
@@ -81,5 +81,8 @@ gmsh.write("t1.msh")
 #
 # gmsh.option.setNumber("Mesh.SaveAll", 1)
 
+# We could run the graphical user interface with
+# gmsh.fltk.run()
+
 # This should be called at the end:
 gmsh.finalize()
diff --git a/tutorial/python/t17.py b/tutorial/python/t17.py
index 4c9de8d9c4..9a5ba009b1 100644
--- a/tutorial/python/t17.py
+++ b/tutorial/python/t17.py
@@ -16,8 +16,8 @@ gmsh.model.occ.synchronize()
 path = os.path.dirname(os.path.abspath(__file__))
 gmsh.merge(os.path.join(path, '..', 't17_bgmesh.pos'))
 
-bg_field = model.mesh.field.add("PostView")
-model.mesh.field.setAsBackgroundMesh(bg_field)
+bg_field = gmsh.model.mesh.field.add("PostView")
+gmsh.model.mesh.field.setAsBackgroundMesh(bg_field)
 
 # use bamg
 gmsh.option.setNumber("Mesh.SmoothRatio", 3)
-- 
GitLab