[Cuis-dev] custom morph with fixed size

ken.dickey at whidbey.com ken.dickey at whidbey.com
Tue Aug 13 07:15:40 PDT 2024


On 2024-08-12 16:53, Mark Volkmann wrote:

> The only reason I chose to make my PlaceholderMorph be a subclass of PlacedMorph instead of BoxedMorph is that 
> with PlacedMorph the canvas passed to drawOn: is a VectorCanvas and 
> with BoxedMorph the canvas passed to drawOn: is a HybridCanvas. 
> I want to use the polyLine: method in VectorCanvas. 
> 
> Is there a way I can configure my custom morph so that if it is a subclass of BoxedMorph, I can get a VectorCanvas in drawTo: ?

If you open a World Menu > Open > Message Names
and type 'canvas', you might note #requiresVectorCanvas

Good writers read a lot. :)

> Is it a better option to modify the layoutSpec in the initialize method so it keeps a fixed size?

LayoutMorph class has a large number of convenience methods to help out
in the 'instance creation' category.

E.g. note code in #keepMorphExtent

Explore the options and make the code do what you want.

4. MÊNG / YOUTHFUL FOLLY

 above KÊN KEEPING STILL, MOUNTAIN
 below K'AN THE ABYSMAL, WATER 

In this hexagram we are reminded of youth and folly in two different
ways. The image of the upper trigram, Kên, is the mountain, that of the
lower, K'an, is water; the spring rising at the foot of the mountain is
the image of inexperienced youth. Keeping still is the attribute of the
upper trigram; that of the lower is the abyss, danger. Stopping in
perplexity on the brink of a dangerous abyss is a symbol of the folly of
youth. However, the two trigrams also show the way of overcoming the
follies of youth. Water is something that of necessity flows on. When
the spring gushes forth, it does not know at first where it will go. But
its steady flow fills up the deep place blocking its progress, and
success is attained. 

THE JUDGMENT 

YOUTHFUL FOLLY has success.
It is not I who seek the young fool;
The young fool seeks me.
At the first oracle I inform him.
If he asks two or three times, it is importunity.
If he importunes, I give him no information.
Perseverance furthers. 

HTH, 

-KenD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240813/04d70549/attachment-0001.htm>


More information about the Cuis-dev mailing list