[Cuis-dev] Bugfix - PluggableButtonMorph
Joel Camera
joel.camera at 10pines.com
Thu May 15 08:47:09 PDT 2025
Hi Folks!
Here I bring a bugfix of PluggableButtonMorph.
The bug is that when changing the label it loses all its padding.
How to trigger it: create a LayoutMorph, create a button, add the button to
the LayoutMorph and then change its label.
layoutMorph := LayoutMorph newColumn.
button := PluggableButtonMorph model: nil action: nil label: 'hello'.
button openInWorld.
layoutMorph addMorph: button.
layoutMorph openInWorld.
button label: 'bye'.
If something new happens to the LayoutMorph (like adding another morph),
the button will recover its padding.
The problem is that when changing the label, it sets the instance variable
extent without telling its parents that it was changed. Fortunately, the
setter of the extent morphExtent: does that and using it solves the problem.
Have a nice day!
<https://10pines.com/>Joel CámeraAgile Software Development
Alem 896, Floor 6, Buenos Aires, Argentina
+54 9 011 6091 3125
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250515/5be8949f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fix#PluggableButtonMorph#extent#problem#when#changing#label-JEC.001.cs.st
Type: application/octet-stream
Size: 494 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250515/5be8949f/attachment.obj>
More information about the Cuis-dev
mailing list