PDA

View Full Version : sd-defdialog with an undefined number of variables


ceuro
11-16-2004, 08:07 AM
It is possible to define a sd-defdialog with an undefined number of variables ?
I have a list of variables to set on the back of the decision made before of the apearing of the sd-defdialog, so I was thinking about passing a list as a parameter .

Something like

:variables
'(dolist (element list_var)
(element
:value-type :string)

Obviously this is wrong.
Is there any workaround ?

dorothea
11-16-2004, 10:06 PM
Do you know the maximum number of variables which appear in the dialog? Then you can create this number of variables and make them invisible (:initial-visible nil). Then if you know how many variables are necessary for a certain situation you just make these variables visible (sd-set-variable-status). This only works if you also know the type of the variables or if all variables have the same type.

It's only a workaround. Perhaps it helps!

Dorothea

Michael Kahle
11-17-2004, 06:07 AM
I usally use a construction like

(setq own-list1 '((abc :value-type :string)
(def :value-type :number)))

(setq own-list2 '(ghi jkl mno))

(sd-defdialog 'test

:variables
`( ;;;;BACKQUOTE !!!!
,@own-list1
,@(mapcar #'(lambda (x) (list x :value-type :string)) own-list2)

)


)

No garanty given - usally spend hours to find out the right
combination of all these '`,@