CLIM mail archive

[Prev][Next][Index][Thread]

handling aborts from accepting values



    Date: Thu, 9 Jul 1992 13:28 EDT
    From: Tom Trinko <ttrinko@dipl.rdd.lmsc.lockheed.com>

    We need to handle aborts arising from the user aborting out of accepting values dialogs.  I've tried 
	(handle-case
	    (abort   #'function)

    but in clim 1.1 genera 8.1.1 it doesn't like abort and sys:abort doesn't work
    and clim-user:abort doesn't work either.  I need to know what condition is generated when the user 
    hits the abort key and/or the abort menu item in an accepting
    values menu which has its own window.  Also any other ways of cleaning up
    after the user aborts, other than handle-case or with-simple-restart, would
    be of interest.  Thanks.

It's a restart, not a condition.  You know that already, because you have a working example
that uses with-simple-restart, viz:

(defun two-menus (stream)
  (with-simple-restart (abort "Return from both menus")
    (accepting-values (stream :own-window t :label "1st Menu")
      (accept 'integer :stream stream :prompt "The number"))
    (accepting-values (stream :own-window t :label "2nd Menu")
      (accept 'integer :stream stream :prompt "The number"))))

This is the rough equivalent with restart-case:

(defun two-menus-2 (stream)
  (restart-case (progn (accepting-values (stream :own-window t :label "1st Menu")
			 (accept 'integer :stream stream :prompt "The number"))
		       (accepting-values (stream :own-window t :label "2nd Menu")
			 (accept 'integer :stream stream :prompt "The number")))
    (abort () :report "Return from both menus"
	   (return-from two-menus-2 nil))))


References:

Main Index | Thread Index