[Newbies] Subclassing PasteUpMorph
limitcase at gmail.com
Wed May 4 17:48:39 UTC 2016
I'm experimenting with subclassing PasteUpMorph to get some additional
behavior. One thing I want to do is have my subclass open with a
CircleMorph at 0 at 0. I already get that behavior, the CircleMorph in the
upper left corner, but want my subclass' origin to be at its center, and
the CircleMorph drawn there. My current initialize method,
self originAtCenter; addMorph: ((CircleMorph new) color: Color white)
centeredNear: 0 at 0.
still places it in the upper left corner.
How do I get the origin, 0 at 0, at the center?
My only other method, so far, sets my subclass default bounds.
"answer the default bounds for the receiver"
^ 0 @ 0 corner: 400 @ 400
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners