CLIM mail archive
Re: Quickie question on formatting-table
Is it possible to use formatting-table, formatting-row, etc. within the
context of accepting-values where each cell in the table would be an
individual accept with its own prompt and default? I'm not sure this is
allowed by what was illustrated in the docs.
That would be extremely handy if it is allowed. Do I need to do anything
special to implement this if it is possible?
Yes, it works, and no, you don't need to do anything special:
just make the pane an accepting-values pane, and put your accepts
inside formatting-cells. I don't have a complete example handy,
but below is the macro I used for all my different tables.
;;; The following macro captures the common pattern: it displays
;;; one editable value in the table. When the value is edited,
;;; the associated code ('body') is executed.
;;; note: it assumes the variable 'stream' is appropriately bound
(defmacro accept-val (val type id &body body)
(let (new-val new-type val-changed)
(multiple-value-bind (new-val new-type val-changed)
(declare (ignore new-type))
(handler-case (progn ,@body)
(show-error "~a" c))))))))
Main Index |