[Q][Morphic] Accept-drop property and re-layout

Hannes Hirzel hirzel at spw.unizh.ch
Thu Mar 7 20:03:45 UTC 2002


Hi

A question regarding dropping a Morph:

Nod Konz's idea to use a TextMorph for a bullet in a bullet list
prompted my to try out another 'hello world'-program version -
a rather longish one. (http://minnow.cc.gatech.edu/squeak/2230)

r := PasteUpMorph new.
r color: Color blue twiceLighter twiceLighter twiceLighter.
r position: 10 at 10.
r extent: 170 at 100.
r openInWorld.

r layoutPolicy: TableLayout new. "lay out contents as a table"
r listDirection: #leftToRight. "how we want to place the contents"
r listCentering: #topLeft. "start list at the top"
r wrapDirection: #topToBottom.
r wrapCentering: #topLeft. 
"r changeDragAndDrop."


'Hello world! How are you doing?' do: [ :ch | 
charTM := TextMorph new.
charTM beAllFont: ((TextStyle default fontOfSize: 36) emphasized: 1).
charTM contentsAsIs: ch asString.
charTM color: Color random.
r addMorphBack: charTM]. 

This works fine. 

When I drag out a character on the black pickup halo and later want to
put it back it will not 'snap into' its place and the other TextMorphs
will not reshuffle. I tried RectangleMorph and Morph as well.

What am I missing? 


Regards
Hannes Hirzel


 




More information about the Squeak-dev mailing list