Discussion move to plplot-devel as this has moved beyond the initial help
request.

On Sun, May 30, 2010 at 06:09:01PM -0700, Alan Irwin wrote:
> On 2010-05-30 12:04-0400 Hazen Babcock wrote:
> 
> > Ok, fixed in v11036. It should now behave like the qtwidget driver, which 
> > does not actually call plexit(). The stream is not really closed, but 
> > nothing 
> > can be plotted anymore so it at least appears closed. In the case of the 
> > examples, what happens is that once you click the close box all the 
> > subsequent plotting commands become nop's.
> 
> Hi Hazen:
> 
> That's great you discovered qtwidget does not use plexit and implemented a
> solution without plexit for the xcairo case as well.  I like your solution
> of using a flag to turn all operations into no-ops when the window has been
> closed. I confirm that solution smoothly exits from examples/c/x02c when you
> close the window regardless of page.  Thanks!

This is a relatively elegant solution which avoids most of the pitfalls with
plplot code being executed after the window has closed. Without full error 
handling in plplot and rewriting lots of user code it is probably the best 
we can do.

> Now a question for Andrew.  If you try either -dev qtwidget or -dev xcairo
> from within octave and close the window are you now happy with the results?

Well it works fine. This is not really the main problem with octave 
though. The big issue is doing something silly which results in plexit being
called in plplot crashes octave as well. Not a good solution. 

> 
> Assuming the answer is yes, then we have both C (cairo.c) and C++ (qt.cpp)
> templates for the proper way to do window closing without plexit clobbering
> the calling environment, and we should propagate those solutions to -dev
> xwin, -dev tk, and -dev wxwidgets.

Agreed, although perhaps it would be more efficient to do this at the library 
level rather than the driver level. We would only have to do it once, and
then any new interactive drivers would simple have to detect the close window
button press and set a flag.

Andrew

------------------------------------------------------------------------------

_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to