Sheet

a simple PageLayout that auto-resizes to fit its contents.

A better name might be Page.

(

Sheet({ arg f;

ActionButton(f,"selectionStart",{});

ActionButton(f,"selectionEnd",{});

});

)

see also [ModalDialog]

Gotcha

(

Sheet({ |f|

f.comp({ |f|

CXLabel(f,"blah");

}).background_(Color.red).resizeToFit;

})

)

Although the composite view inside has been shrunk down to fit its contents, the flow view's decorator still has the large size accounted for as "used up" (the maximum that was available for the composite view to consume).

solution:

(

Sheet({ |f|

f.comp({ |f|

CXLabel(f,"blah");

}).background_(Color.red).resizeToFit;

f.reflowAll;

})

)