哇!
这就是我一直在寻找的。但是为什么单击按钮不会自动拾取与按钮关联的lisp。。。。。例如,单击按钮1应激活加法lisp
- (defun C:test( / cmd dcl ret)
- (setq dcl (load_dialog "test.DCL")) ; Load DCL.
- (if (new_dialog "dcl_test" dcl)
- (progn
- [color="blue"] (action_tile "C1" "(done_dialog 1)")
- (action_tile "C2" "(done_dialog 2)")
- (action_tile "C3" "(done_dialog 3)")[/color]
- (setq ret (start_dialog)) ; If Cancel is pressed ret will be 0.
- (unload_dialog dcl)
- )
- (alert "Can't load the dialog!")
- )
- (cond
- [color="blue"] ( (zerop ret)(alert "\nFunction CANCELLED by user"))
- ( (eval (cadr (assoc ret
- '( ( 1 (_func1 "Hey Dude"))
- ( 2 (_func2 "What?"))
- ( 3 (_func3 "Seriously"))
- )
- )
- )
- )
- )[/color]
- )
- (princ)
- )
- [color="blue"](defun _func1 (m)
- (alert (strcat m " The Earth is FLAT")))
- (defun _func2 (m)
- (alert (strcat m " No its NOT, The Earth is round")))
- (defun _func3 (m)
- (alert (strcat m " Its actually a bumpy spheroid")))[/color]
|