To make a pane that is wide enough to accomodate a given string, use the
hint with a
In this example we also supply
, which fixes the maximum visible width to be the same as the minimum visible width. Hence the pane is wide enough, but no wider:
(defvar *text* "Exactly this wide")
:visible-min-width `(:string ,*text*)
:size (+ 6 (random 30)))))
Note that the width constraint works regardless of the font used.