From: Ethan A M. <sf...@us...> - 2018-08-17 20:44:16
|
On Friday, August 17, 2018 1:15:24 PM PDT Dima Kogan wrote: > Hi. > > I'm looking for a feature that (I think) doesn't exist currently. Want > to ask first, in case something DOES exist that I'm not seeing. This ought to be a FAQ or something. The command you are looking for is pause mouse close Recent discussion has indicated that on some systems in may also be necessary add a bind command bind "Close" "exit gnuplot" pause mouse close gnuplot will exit when the user closes the plot window. If you want gnuplot to signal the parent application via some side channel rather rather than exiting , that's a bit trickier. There are several options but the details are OS dependent. For example (not necessary the best option) bind "Close" "system('kill -SIGCONT $PARENTID')" Ethan > A number of applications that make plots use gnuplot as a backend. The > sequence you want there is: > > 1. User says "make a plot" > > 2. Application tells gnuplot to make a plot > > 3. gnuplot does its thing using an interactive terminal (x11, qt, wxt, > ...) and a plot window pops up > > 4. user looks at the plot, then closes the window when they're done, and > wants to continue using the application > > The issue here is that currently the application (parent of the > "gnuplot" process) has no way of knowing when the user finished looking > at the plot, which necessitates ugly workarounds. For instance with > gnuplotlib I can write a script that just makes a plot. If I just call > gnuplotlib.plot(), then the application will make a plot and then exit > immediately. As a workaround I put a sleep(10000) after the plot() call. > I'd like to have some sort of gnuplotlib.wait() that blocks until > gnuplot is done. Maybe gnuplot can be asked to print something on the > console when the client window is closed, or something? Thoughts? |