Message 1 of 7
Do nothing on Cancel (Dialog Box)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have incorporated a dialog box on a lisp this community has helped me create, I added this dialog box on an insert lisp but I am having trouble with canceling out from the dialog box.
Initially when I click on cancel, what the lisp does is just carry on the previous action.
ie:
If I click "ok", it inserts the block called for.
then if I call the lisp again and this time click "cancel" the lisp just inserts the previous block inserted.
So I thought to add an "(exit)" in the cancel action_tile like so
(action_tile
"cancel"
"(done_dialog)
(setq result nil)
(exit)
"
it does the job of not carrying out the previous action but I get this error
; error: quit / exit abort
I can work with that but I dont want it to be an "error".
How can I fix this? Below is the DCL and the Lisp.
DCL :
inputbox : dialog
{
label = "Block Lookup Tool";
width = 50;
: text { key = "prompt"; }
: edit_box { key = "ebox1"; allow_accept = true; }
ok_cancel;
}
LISP :
(defun inputbox (prompt title default)
(setq dcl_id (load_dialog "inputbox.dcl"))
(if (not (new_dialog "inputbox" dcl_id))
(exit)
)
(set_tile "prompt" prompt)
(set_tile "title" title)
(set_tile "ebox1" default)
(mode_tile "ebox1" 2)
(action_tile
"accept"
"(setq inputvalue (get_tile \"ebox1\"))
(done_dialog)
(setq result T)"
)
(action_tile
"cancel"
"(done_dialog)
(setq result nil)
(exit)
"
)
(start_dialog)
(unload_dialog dcl_id)
(princ)
)
(princ)