# HG changeset patch # User John W. Eaton # Date 1216761808 14400 # Node ID 5747be3ac49701b528693d40996e8c39db0dbf73 # Parent 6a6a030a3517d0f168fe5b1bfec8729a2af23f3a Implement closereq as real callback execution diff -r 6a6a030a3517 -r 5747be3ac497 scripts/ChangeLog --- a/scripts/ChangeLog Tue Jul 22 16:03:44 2008 -0400 +++ b/scripts/ChangeLog Tue Jul 22 17:23:28 2008 -0400 @@ -1,3 +1,9 @@ +2008-07-21 Michael Goffioul + + * plot/closereq.m: Use first gcbf to get the handle of the figure to + be closed. + * plot/close.m: Call __go_execute_callback__. + 2008-07-17 John W. Eaton * general/fliplr.m: Fix usage test. diff -r 6a6a030a3517 -r 5747be3ac497 scripts/plot/close.m --- a/scripts/plot/close.m Tue Jul 22 16:03:44 2008 -0400 +++ b/scripts/plot/close.m Tue Jul 22 17:23:28 2008 -0400 @@ -59,8 +59,7 @@ endif for h = figs - set (0, "currentfigure", h); - feval (get (h, "closerequestfcn")); + __go_execute_callback__ (h, "closerequestfcn"); endfor if (nargout > 0) diff -r 6a6a030a3517 -r 5747be3ac497 scripts/plot/closereq.m --- a/scripts/plot/closereq.m Tue Jul 22 16:03:44 2008 -0400 +++ b/scripts/plot/closereq.m Tue Jul 22 17:23:28 2008 -0400 @@ -28,8 +28,12 @@ function closereq () if (nargin == 0) - cf = get (0, "currentfigure"); - if (cf != 0) + cf = gcbf (); + if (isempty (cf)) + warning ("closereq: calling closereq from octave prompt is not supported, use `close' instead"); + cf = get (0, "currentfigure"); + endif + if (! isempty (cf) && cf != 0) delete (cf); endif else