Laying out Morphs with submorphs outside their bounds

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Laying out Morphs with submorphs outside their bounds

Sean P. DeNigris
Administrator
I created a ThoughtBalloonMorph seen here (think of a cartoon if you can't see the image):


It is an invisible morph with three submorphs:
* an EllipseMorph with an embedded TextMorph
* two small CircleMorphs leading from the thinker to the thought.

The problem is that the #bounds of the Morph is 0@0 (for the invisible Morph). Thus, when I add it to a PasteUpMorph with #shrinkWrap resizing, the submorphs are not taken into account and may be cut off, as seen here:


What's the best way to overcome this?

Thanks.
Sean

p.s. if you're not viewing this on Nabble, did the images work? (I added them on Nabble.)
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Laying out Morphs with submorphs outside their bounds

Sean P. DeNigris
Administrator
Now that I think about it, the question is really: how does one create a morph that is made up of multiple non-overlapping morphs with no background?

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Laying out Morphs with submorphs outside their bounds

patmaddox
Did you ever solve this? I think the way to go is with an invisible container morph, that all of these little bubbles get attached to. Did you try that? What happened?

Pat


On Mar 15, 2011, at 4:20 PM, Sean P. DeNigris wrote:

> Now that I think about it, the question is really: how does one create a
> morph that is made up of multiple non-overlapping morphs with no background?
>
> Sean
>
> --
> View this message in context: http://forum.world.st/Laying-out-Morphs-with-submorphs-outside-their-bounds-tp3376956p3380422.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Laying out Morphs with submorphs outside their bounds

Sean P. DeNigris
Administrator
Pat Maddox-3 wrote
Did you ever solve this? I think the way to go is with an invisible container morph, that all of these little bubbles get attached to. Did you try that? What happened?
I didn't solve it yet. I have an invisible parent morph, but I set its size to 0@0. The reason I didn't just have it cover the total area of the composite is that I want mouse actions (e.g. clicks) that are within the area but not actually on one of the bubbles to go through to the background. I guess I could override the event handlers and forward them manually, but I thought someone might know a better way.

Thanks.
Sean
Cheers,
Sean