Hi
I'm working on 16969 https://pharo.fogbugz.com/f/cases/16969/ which is basically cleaning the use of rectangle instead of using Margin. Now I'm surprised because GLMRubScrolledTextBrick>>withoutMargins uses self margins: but I cannot find the method. Did I misses something? I rewrote it as withoutMargins self margins: (0@0) asMargin but I'm still curious. Stef |
>>GLMRubScrolledTextBrick>>withoutMargins uses self margins: but I
cannot find the method. This is because it is implemented in RubScrollTextMorph. GLMRubScrolledTextBrick implements #doesNotUnderstand: to send it to the rubric object. see: https://pharo.fogbugz.com/f/cases/17888/GLMRubScrolledTextBrick-relies-on-dnu-delegation Best regards, Henrik -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html |
Hi,
GLMRubScrolledTextBrick is a wrapper around RubScrollTextMorph. I see that it is a common practice in Pharo to implement decorator / wrapper pattern using doesNotUnderstand:. Reference: - AthensWrappedWorldDisplay - DictionaryValueHolder - MorphicTreeAdapter - RubEditingArea - RubParagraphDecorator - RTShapeBuilder - RTShowLabel Is there a better way to implement a decorator or a wrapper around the object with many api methods rather then doesNotUnderstand:? Cheers, Alex On 9 December 2017 at 17:45, Henrik-Nergaard <[hidden email]> wrote: >>GLMRubScrolledTextBrick>>wit |
Argh! I did not thought about it.
So it may means that my changes are breaking the system. Aliaksei DNU is a ship way. The other way is as you expect I'm sure adding a method that just does the delegation. What we can do is to turn the DNU into a DNU compiling methods like that after a while we will have the method compiled and we will able to remove the DNU trick. stef On Thu, Dec 14, 2017 at 6:46 PM, Aliaksei Syrel <[hidden email]> wrote: > Hi, > > GLMRubScrolledTextBrick is a wrapper around RubScrollTextMorph. > I see that it is a common practice in Pharo to implement decorator / wrapper > pattern using doesNotUnderstand:. > > Reference: > - AthensWrappedWorldDisplay > - DictionaryValueHolder > - MorphicTreeAdapter > - RubEditingArea > - RubParagraphDecorator > > - RTShapeBuilder > - RTShowLabel > > Is there a better way to implement a decorator or a wrapper around the > object with many api methods rather then doesNotUnderstand:? > > Cheers, > Alex > > On 9 December 2017 at 17:45, Henrik-Nergaard <[hidden email]> wrote: >> >> >>GLMRubScrolledTextBrick>>withoutMargins uses self margins: but I >> cannot find the method. >> This is because it is implemented in RubScrollTextMorph. >> GLMRubScrolledTextBrick implements #doesNotUnderstand: to send it to the >> rubric object. >> see: >> >> https://pharo.fogbugz.com/f/cases/17888/GLMRubScrolledTextBrick-relies-on-dnu-delegation >> >> Best regards, >> Henrik >> >> >> >> -- >> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html >> > |
Ok so since I paid attention and rewrote all the margins: invocations
I think that my changes will not break On Fri, Dec 15, 2017 at 9:32 PM, Stephane Ducasse <[hidden email]> wrote: > Argh! I did not thought about it. > So it may means that my changes are breaking the system. > Aliaksei DNU is a ship way. The other way is as you expect I'm sure > adding a method that just does the delegation. > What we can do is to turn the DNU into a DNU compiling methods like > that after a while > we will have the method compiled and we will able to remove the DNU trick. > > stef > > On Thu, Dec 14, 2017 at 6:46 PM, Aliaksei Syrel <[hidden email]> wrote: >> Hi, >> >> GLMRubScrolledTextBrick is a wrapper around RubScrollTextMorph. >> I see that it is a common practice in Pharo to implement decorator / wrapper >> pattern using doesNotUnderstand:. >> >> Reference: >> - AthensWrappedWorldDisplay >> - DictionaryValueHolder >> - MorphicTreeAdapter >> - RubEditingArea >> - RubParagraphDecorator >> >> - RTShapeBuilder >> - RTShowLabel >> >> Is there a better way to implement a decorator or a wrapper around the >> object with many api methods rather then doesNotUnderstand:? >> >> Cheers, >> Alex >> >> On 9 December 2017 at 17:45, Henrik-Nergaard <[hidden email]> wrote: >>> >>> >>GLMRubScrolledTextBrick>>withoutMargins uses self margins: but I >>> cannot find the method. >>> This is because it is implemented in RubScrollTextMorph. >>> GLMRubScrolledTextBrick implements #doesNotUnderstand: to send it to the >>> rubric object. >>> see: >>> >>> https://pharo.fogbugz.com/f/cases/17888/GLMRubScrolledTextBrick-relies-on-dnu-delegation >>> >>> Best regards, >>> Henrik >>> >>> >>> >>> -- >>> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html >>> >> |
Free forum by Nabble | Edit this page |