I am currently working on a way to specify different layout policy.

But until it works, there is no real way to do it.

A dirty patch in the meantime would be to specify the policy to the morph when 
built.
Ben

On 02 Jan 2014, at 16:26, Sean P. DeNigris <[email protected]> wrote:

> I want to specify that the label column should shrinkWrap the text. In
> Morphic, it would be something like:
> 
> 
>> gui := Morph new
>>      changeTableLayout;
>>      layoutInset: 10@10;
>>      listDirection: #leftToRight;
>>      vResizing: #spaceFill;
>>      hResizing: #spaceFill;
>>      yourself.
>>      
>> row := UITheme current builder newRow: { 
>>      TextMorph new contents: 'label'; color: Color yellow; yourself.
>>      Morph new color: Color green; hResizing: #spaceFill; yourself
>>      }.
>> row
>>      hResizing: #spaceFill.
>> 
>> gui 
>>      addMorphBack: row.
>>      
>> gui openInWindow.
> 
> Any time 'label' changes to a shorter or longer string, both the label and
> green morph adjust accordingly.
> 
> Right now, DateModel has this in class-side #spec…
> 
> 
>>      ^ SpecLayout composed
>>              newRow: [ :row | 
>>                      row 
>>                              add: #dateLabel" width: 60"; 
>>                              "This is to address a not yet fixed Spec issue"
>>                              newRow: [:ugly | 
>>                                      ugly
>>                                              add: #dateModel;  
>>                                              add: #chooseDateButton width: 
>> 50 ]] height: 25
>>              yourself.
> 
> Currently, since the label column width is hard-coded, substituting longer
> labels looks really crappy.
> I don't remember what the "issue" was, but how do I recreate the above
> Morphic behavior with Spec?
> 
> 
> 
> 
> -----
> Cheers,
> Sean
> --
> View this message in context: 
> http://forum.world.st/DateModel-label-width-tp4733674.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
> 

Reply via email to