[squeak-dev] [Tools] (Object >> #inspect) now returns the tool
instead of the object
David T. Lewis
lewis at mail.msen.com
Tue May 19 12:19:01 UTC 2015
On Tue, May 19, 2015 at 01:50:07AM -0700, marcel.taeumel wrote:
> Hi, there! :)
>
> I just want to mention and explain, why (Object >> #inspect) now returns the
> tool window instead of the object as in 4.5.
>
> The Tools package adds several convenient methods to the base system:
>
> Object >> #explore
> Object >> #inspect
> Object >> #browse
> Behavior >> #browse
>
> All but #inspect returned the created tool. So I went for consistency. But
> in particular, those methods should return the tool because because
> otherwise the programmer has no simple means to access the created
> window/tool programmatically. Model and object are, however, always
> accessible (via #model or just #self).
Thanks for the explanation. I think that you made the right choice.
Dave
>
> So if you got code like this:
>
> self someObjects add: myObject inspect.
>
> Please change it to:
>
> self someObjects add: myObject inspect; yourself.
>
> Or even better to:
>
> myObject inspect.
> self someObjects add: myObject.
>
> I think that it is good practice/style to use #yourself if you want to get
> the receiver back in a chain of calls:
>
> self myMorphs add: (MyMorph new color: Color yellow; yourself).
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/Tools-Object-inspect-now-returns-the-tool-instead-of-the-object-tp4827263.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
More information about the Squeak-dev
mailing list
|