Please add a comment in the method stating it. People are not reading your mind. Stef Le 9/2/16 13:25, Aliaksei Syrel a écrit :
formerOwner: anElementOrNil "Set my former or remove property of argument is nil"
anElementOrNil ifNil: [ self removeProperty: #formerOwner ] ifNotNil: [ self setProperty: #formerOwner toValue: anElementOrNil ]
I hate this method :) It is identical to Morph>>#formerOwner: (ctrl+c, ctrl+v) Basically it should be removed after reimplementation of drag&drop mechanism. Current one was copied from morphic to support compatibility. We will need to find better solution. Drag&drop is not so easy to do right. Help from community is appreciated :)
Cheers, Alex
On Tue, Feb 9, 2016 at 1:12 PM, Stephan Eggermont <stephan@stack.nl <mailto:stephan@stack.nl>> wrote:
formerOwner: anElementOrNil "Set my former or remove property of argument is nil"
anElementOrNil ifNil: [ self removeProperty: #formerOwner ] ifNotNil: [ self setProperty: #formerOwner toValue: anElementOrNil ]
I'd prefer to see a #setProperty:toValueOrRemove: there, as that pattern is used a lot.
Stephan