<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Oh, gosh.<br>
<br>
I read your previous message in haste, and only tried the first
script. Yes, when you add the WidgetMorph, drawing breaks. The
reason is that WidgetMorph is a superclass of system widgets. One
assumption is that widgets don't have submorphs that protrude them.
This is true for SystemWindows and all the other widgets in the
hierarchy. It allows the framework to do some optimizations when
computing dirty rectangles (i.e. the display rectangles that need to
be redrawn). If you define #submorphsMightProtrude to answer true,
then drawing works ok. Still, my suggestion is to just use a new
subclass of MovableMorph, or maybe a copy of it (right click on
MovableMorph / copy class... ), and only ensure that
#submorphsMightProtrude answers true in this new class.<br>
<br>
WRT your other question (I completely missed it earlier today), no.
Cuis doesn't include "shrink wrap" morphs. I guess it shouldn't be
difficult to implement it for your own morph. Cuis Layouts are based
on the opposite idea: each morph decides the location and maybe
extent of its submorphs.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
<br>
On 7/26/2021 8:53 PM, Nicolás Papagna Maldonado via Cuis-dev wrote:
<blockquote
cite="mid:CADGn7BP-cWTp6p2Jg=Uv1gV=icSkHtcKrsUxahVqUttVx_oVxw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Juan!
<div><br>
</div>
<div>Thanks for taking the time to look into this.</div>
<div><br>
</div>
<div>I've cloned the Cuis repo and was able to reproduce the
artifacts that are shown in the video link I shared in the
previous email.</div>
<div><br>
</div>
<div>label := UpdatingLabelMorph new<br>
target: [<br>
self runningWorld submorphs<br>
detect: [ :morph | morph containsGlobalPoint: self
runningWorld activeHand morphPositionInWorld ]<br>
ifFound: [ :morph | morph class name ]<br>
ifNone: [ 'nothing here' ]<br>
];<br>
getSelector: #value;<br>
stepTime: 10.<br>
<br>
self<br>
runningWorld<br>
activeHand<br>
attachMorphBeside: (WidgetMorph new addMorph: label).<br>
</div>
<div><br>
</div>
<div>Tried running updated too, but that didn't work.</div>
<div><br>
</div>
<div>Am I missing something?</div>
<div><br>
</div>
<div>Best,</div>
<div>Nico PM</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Jul 26, 2021 at 4:03
PM Juan Vuletich <<a moz-do-not-send="true"
href="mailto:juan@jvuletich.org">juan@jvuletich.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#ffffff"> Hi Nico,<br>
<br>
Your code works perfectly well on my pc on an updated Cuis.
Maybe the bug you see has already been fixed?<br>
<br>
Cheers,<br>
<pre cols="72">--
Juan Vuletich
<a moz-do-not-send="true" href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a moz-do-not-send="true" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a moz-do-not-send="true" href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a moz-do-not-send="true" href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
<br>
<br>
On 7/25/2021 3:39 PM, Nicolás Papagna Maldonado via Cuis-dev
wrote:
<blockquote type="cite">
<div dir="ltr">Friendly bump to see if anyone has a lead
on this one :)
<div><br>
</div>
<div>Thanks in advance,</div>
<div>Nico PM</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jul 20, 2021
at 4:17 PM Nicolás Papagna Maldonado <<a
moz-do-not-send="true"
href="mailto:nicolas.papagna@gmail.com"
target="_blank">nicolas.papagna@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px
0px 0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div dir="ltr">Aloha folks!
<div><br>
</div>
<div>I've run into the following issue. I'll do my
best to explain it with the following example.</div>
<div><br>
</div>
<div>TL;DR see video reproducing the issue here: <a
moz-do-not-send="true"
href="https://drive.google.com/file/d/1HikB46LCob-bf-W4LOnT_azH-0ohlB9I/view?usp=sharing"
target="_blank">https://drive.google.com/file/d/1HikB46LCob-bf-W4LOnT_azH-0ohlB9I/view?usp=sharing</a></div>
<div><br>
</div>
<div>Let's say I want to display the class name of a
morph when I point to it.</div>
<div>If I do this, everything works fine:</div>
<div><br>
</div>
<div>label := UpdatingLabelMorph new<br>
target: [<br>
self runningWorld submorphs</div>
<div> detect: [ :morph | morph
containsGlobalPoint: self runningWorld activeHand
morphPositionInWorld ]</div>
<div> ifFound: [ :morph | morph class
name ]</div>
<div> ifNone: [ 'nothing here' ]</div>
<div> ];<br>
getSelector: #value;<br>
stepTime: 10.<br>
<br>
self<br>
runningWorld<br>
activeHand<br>
attachMorphBeside: label.<br>
<br>
If I try to attach a morph that contains the label
defined above (say I want to display something
fancier, not just a label), then every time I drag
the mouse the label behaves like a "pen"
leaving traces of its old renders on the canvas:</div>
<div><br>
self<br>
runningWorld<br>
activeHand<br>
attachMorphBeside: (WidgetMorph new addMorph:
label).<br>
<br>
My gut feeling is that this might be related to
the fact that the WidgetMorph that contains the
label is not aware that it is rendered outside of
its bounds, but I don't have much experience with
Morphic.</div>
<div><br>
</div>
<div>1) Am I doing something wrong/missing
an important concept for understanding how Morphic
works?</div>
<div>2) Related to that: I often find myself
wrapping a bunch of morphs to add behavior/glue
code to them, but that wrapper does not do any
rendering. What would be the right way to adjust
the wrapper's extent to fit its
submorphs perfectly (e.g. no extra space/no
clipping)?</div>
<div><br>
</div>
<div>Thanks in advance,</div>
<div>Nico PM</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr"><br>
Nicolás Papagna</div>
</blockquote>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature"><br>
Nicolás Papagna</div>
</blockquote>
</body>
</html>