[Newbies] How do I find out the maximum extent that a morph can be set to, without this impacting the current extent of its owner morph?

Alexandre Rousseau alexr at mailsnare.net
Wed Nov 28 17:31:58 UTC 2007


The owner morph (a stickie note title bar) contains 3 submorphs:
1. a SimpleButtonMorph, to trigger collapse/expansion of the stickie  
note (collapsed = stickie note's editor submorph hidden)
2. a StringMorph: contains a summary -- a contracted copy -- of the  
stickie note's editor's contents. The length of that summary depends  
on the maximum amount of horizontal space available to the containing  
StringMorph.
3. a StringMorph: set to the last modification date of the stickie note.

Therein lies my problem: to determine the maximum space that #2 can  
occupy before provoking a resize of the stickie note, and given that  
stickie note widths are left to user discretion, i.e., vary.

Alex


On 28-Nov-07, at 9:19 PM, karl wrote:

> Alexandre Rousseau wrote:
>> Hi Jerome
>>
>> Thanks for your advice. The parent morph in question is variable  
>> in width (user discretion), includes several submorphs, including  
>> that for which I would like to calc the maximum "non-impacting"  
>> extent, and uses a layoutPolicy. And yes, that parent has  
>> insets... set, too. So I am a bit hesitant. Will try some stuff.
> Does not #spaceFill do just fill the max available space ?
>
> Karl
>>
>> Thanks again
>> Alex
>>
>>
>> On 28-Nov-07, at 4:15 PM, Jerome Peace wrote:
>>
>>> [Newbies] How do I find out the maximum extent that a
>>> morph can be set to, without this impacting the
>>> current extent of its owner morph?
>>>
>>>
>>> Hi Alexandre,
>>>
>>>
>>> My first guess would be:
>>>
>>> maxBounds := myMorph owner bounds
>>> myMorph bounds: maxBounds.
>>>
>>> and my second guess would be:
>>> necessaryInset := 1
>>> maxBounds := maxBounds insetBy: necessaryInset .
>>>
>>> and try for a third guess:
>>> necessaryInset := necessaryInset  + 1 .
>>>
>>> etc.
>>>
>>> And I would use a squeak workspace to find out what I
>>> needed to know. And then I would know it. (Report back
>>> here you results)
>>>
>>> Cheers.
>>>
>>> Yours in curiosity and service, --Jerome Peace
>>>
>>>
>>> ***
>>>>
>>>> Alexandre Rousseau alexr at mailsnare.net
>>>> Wed Nov 28 05:27:28 UTC 2007
>>>>
>>>> Hi all
>>>>
>>>> Question: How do I find out the maximum extent that a
>>> morph can be
>>>> set to, without this impacting the current extent of
>>> its owner morph?
>>>> Context: trying to set the extent of a sticky note's
>>> summary label to
>>>> the maximum possible width, and such that the note's
>>> window (isKindOf
>>>> PasteUpMorph) will not be resized.
>>>>
>>>> Thanks in advance
>>>> Alex
>>>>
>>>> ==
>>>> Alexandre Rousseau
>>>> E: alexr at mailsnare.net
>>>> NinerPaint: http://www.ninerpaint.com
>>> ***
>>>
>>>
>>>
>>>
>>>        
>>> ____________________________________________________________________ 
>>> ________________
>>> Be a better pen pal.
>>> Text or chat with friends inside Yahoo! Mail. See how.  http:// 
>>> overview.mail.yahoo.com/
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners



More information about the Beginners mailing list