<div dir="ltr"><div dir="ltr"><div dir="ltr">thanks for the answer, <div>"To break the loop simply close the Gmsh window" as I said, I cannot close gmsh (cross or ctrl+q) and I need to close spyder so that gmsh finally closes itself; still trying to figure out why</div><div><br></div><div>Paul</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 1 avr. 2020 à 11:32, Christophe Geuzaine <<a href="mailto:cgeuzaine@uliege.be" target="_blank">cgeuzaine@uliege.be</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 31 Mar 2020, at 11:59, paul francedixhuit <<a href="mailto:paul18fr@gmail.com" target="_blank">paul18fr@gmail.com</a>> wrote:<br>
> <br>
> Hi<br>
> <br>
> One would say this is not the "normal" use of the Gmsh API, but for my developments under Python, I'm always coding under Spyder IDE (and I would like to continue if possible).<br>
> <br>
> I've been noticing that when Gmsh GUI needs to be opened (t8.py case for example), then it becomes not possible to close it and it's necessary to close Spyder as well (of course it works fine in commande line).<br>
> <br>
> Can we imagine something like gmsh.close()?<br>
> <br>
> In addition as I've ever said in a previous post, Gmsh API can be used:<br>
> • either by defining the PYTHONPATH as described in the doc (I've defined it in the .bashrc file)<br>
> • either by explicitly implementing it at the beginning of the Python file (see sys.path.append)<br>
> Find some screenshots in attachment<br>
> <br>
<br>
When you call gmsh.fltk.run(), FLTK basically runs a while(1) loop waiting for graphical interface events. To break the loop simply close the Gmsh window.<br>
<br>
You can also run the event loop yourself in Python: don't call gmsh.fltk.run(), but gmsh.fltk.wait() each time to want to wait for an event. See demos/curstom_gui.py for a complete example.<br>
<br>
Christophe<br>
<br>
> Stay at home<br>
> <br>
> Paul<br>
> <br>
> <screenshot2.png><screenshot1.png><screenshot3.png>_______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
> <a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
<br>
— <br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science <br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" rel="noreferrer" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
<br>
<br>
</blockquote></div>