Some CAPI questions
Hi Folks,
Could I ask a few questions about writing code using CAPI?> 1. If I am placing a number of titled panes in a column-layout, is there any way to tell the tiles to all be the same width so that the panes line up (other than using a grid layout instead and making the titles unconnected panes)? Setting a fixed width of the titles will work: (capi:contain (make-instance 'capi:column-layout :description (list (make-instance 'capi:text-input-pane :title "first" :title-args '(:visible-min-width 80)) (make-instance 'capi:text-input-pane :title "second" :title-args '(:visible-min-width 80))))) If you don't want to specify exact pixel values, you could use the length of the longest string (but you would have to find that string yourself and repeat its value): (capi:contain (make-instance 'capi:column-layout :description (list (make-instance 'capi:text-input-pane :title "first" :title-args '(:visible-min-width (:string "second"))) (make-instance 'capi:text-input-pane :title "second" :title-args '(:visible-min-width (:string "second")))))) This will make the titles line up, but they will still be left-aligned. As far as I know, there is no (good) way to have the titles right-aligned other than using a grid-layout or wrapping the titles in row-layouts. > 2. If I am placing a number of display-panes in a column-layout, is there any way to tell the panes to expand to the width of the entire column-layout rather than only being big enough to hold their content? I can see a number of layout options in the various subclasses of display-pane but none of them seem to relate to expanding. You can pass :visible-max-width nil to the display-panes. Note that in some cases, this makes the containing column-layout expand to some apparently random (but large) width. > 4. Is there a way to avoid using global variables to hold values that are addressed by callbacks, other than using a lambda to "curry in" an instance pointer or local variable when defining the interface? Many of the CAPI classes (in particular the capi:item subclasses) support a data slot, so if the object in question is e.g. a menu item, you can store values there, and then use :callback-type :data (or :interface-data or whatever) to have it passed to the callback(s). Erik _______________________________________________ Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html
Unable to parse email body. Email id is 13318