[squeak-dev] A LayoutPolicy for non-formulaic layouts

Chris Muller asqueaker at gmail.com
Thu Mar 13 20:35:38 UTC 2014


It sounds like a good candidate for the Inbox, so we can get a better
understanding of our interest.

On Wed, Mar 12, 2014 at 7:56 PM, tim Rowledge <tim at rowledge.org> wrote:
> Currently there are three morphic layout polices; TableLayout, ProportionalLayout and nil. Table & Proportional do formula based laying out and nil just leaves each morph where its position put it.
>
> For various reasons I need a policy that can be more morph specific, without wanting to go overboard with sophisticated gew-gaws. So I implemented (well honestly it’s a bit of a stretch to call a subclass with one method implementing, but there y’go) ‘DelegatedLayout’ which is a singleton class that just passes the #layout:in: message off to the morph that is the first argument by sending it  #fixUpLayoutIn: {the second argument}. My morphs (that need this policy) then just implement #layoutPolicy to return `DelegatedLayout new`, which returns the singleton instance. After that, they are integrated into the whole #fullBounds/#doLayoutIn: system of updating. I’ve had so very much fun debugging the side-effects of this change, finding an amazing number of recursions and other semantic infelicities.
>
> One could of course go for a parameterised version where the selector is set by the user but I think that may be going too far.
>
> If anyone is interested in the idea I’m happy to stick it into the general trunk but I thought I’d
> a) see if it has any attraction
> b) see if anyone has clever improvements
> before just doing it.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: DST: Deadlock System Tables
>
>
>


More information about the Squeak-dev mailing list