注:变量LST要跟对话框中的list对应,因为list_box返回的是选中项的索引值
;程序内容------------
- (defun c:test( / dcl_id lst)
- (setq lst '("A" "B" "C"))
- (if (< (setq dcl_id (load_dialog "dy")) 0) (exit))
- (if (not (new_dialog "mydcl" dcl_id)) (exit))
- (action_tile "tt" "(set_tile "title" (nth (atoi $value) lst))")
- (start_dialog)
- (unload_dialog dcl_id)
- (princ)
- )
对话框内容------------------
- // dcl试验对话框
- mydcl : dialog {
- label = "试验";
- :text {label="要修改的标题"; key = "title";}
- : list_box {label="要修改的标题"; key = "tt"; list = "A\nB\nC";
- }
- ok_cancel;
- }
|