Re: Does a option pane support items with a tabulator?
Thanks Dave, Exactly what I am looking for! >(format nil "~A~8T~A" x (format nil "Great ~A" (string-capitalize x))) The ~8 was the tabulator value! This example code and the example from title frame would be nices addings to the example section for LW. Regards Hans-Peter -----Ursprüngliche Nachricht----- Von: David Fox [mailto:davef@xanalys.com] Gesendet: Dienstag, 17. Juni 2003 18:06 An: Wickern, Hans- Peter Cc: lisp-hug@xanalys.com Betreff: Re: Does a option pane support items with a tabulator? Is it possible to put a string containig a tab as an item in an option pane? Yes, though it does not display nicely. If so, is the tabulator value settable? What is the tabulator value? I don't think you can have dynamic formatting within the option-pane item if that is what you mean. Taken from the examples: (capi:define-interface option-pane-test () () (:panes (color-chooser capi:option-pane :accessor color-chooser :title "Color:" :items (list (concatenate 'string "red" #\Tab "Great Red") :green :blue :white :black) :print-function 'string-capitalize :selection-callback 'option-pane-set-color) (color-square capi:output-pane :accessor color-square)) (:layouts (default-layout capi:column-layout '(color-chooser color-square))) (:default-initargs :title "Option Pane Test" :best-height 200)) Your code above signals an error because CONCATENATE expects SEQUENCE arguments. Call STRING-APPEND instead of CONCATENATE, or pass (STRING #\Tab). How about this? I use FORMAT ~T for the Tab and specify a fixed-width font: (capi:define-interface option-pane-test () () (:panes (color-chooser capi:option-pane :accessor color-chooser :title "Color:" :items '(:red :green :blue :white :black) :print-function #'(lambda (x) (format nil "~A~8T~A" x (format nil "Great ~A" (string-capitalize x)))) :font (gp:make-font-description :stock :system-fixed-font) :selection-callback 'option-pane-set-color) (color-square capi:output-pane :accessor color-square)) (:layouts (default-layout capi:column-layout '(color-chooser color-square))) (:default-initargs :title "Option Pane Test" :best-height 200)) Dave Fox Xanalys Compass House Vision Park Chivers Way Histon Cambridge CB4 9AD England Email: davef@xanalys.com Tel: +44 1223 253793 Fax: +44 1223 257812 These opinions are not necessarily those of Xanalys.