Hi,
Here is a working example regardless of your other functions that you did not include into the program.
NOTE: You don't need to the CLEAR button now unless you want it for something else and I also disabled the 'OK' button since that I don't know that those functions that are included into this action_tile do.
Code:
(defun c:test (/ _LayerStatePrefix _NativeLayerStates _DialogID additems run lst )
(defun additems (items)
(start_list "ExistLayState")
(mapcar 'add_list items)
(end_list)
)
;; ;;
(setq run nil)
(if (and (setq _DialogID
(load_dialog "NativeLayerState.dcl"
)
)
(< 0 _DialogID)
)
(while
(not
(cond
((not (new_dialog "NativeLayerState" _DialogID))
(princ "\nDialog couldn't be loaded.")
)
((progn (mode_tile "NewLayState" 2)
(action_tile
"NewLayState"
"(setq lst (list (get_tile \"NewLayState\")))"
)
(action_tile
"ExistLayState"
"(set_tile \"NewLayState\" \"\") (setq lst nil)"
)
;;;(action_tile "ok" "(if (layerstate-has ^LayerStateName) (layerstate-delete ^LayerStateName))
;;; (setq done (done_dialog) )
;;; (unload_dialog _DialogID)")
(action_tile
"cancel"
"(setq run (done_dialog)) (unload_dialog _DialogID)"
)
(if lst
(additems lst)
)
(zerop (start_dialog))
)
)
(run (unload_dialog _DialogID))
)
)
)
)
(princ)
)