[squeak-dev] Please try out | Inspector Refactoring =)

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Apr 17 23:18:25 UTC 2020


Hi Stef, many thanks for trying out the changeset and finding the bug! :-)


I'm not sure if there is already a better pattern to fix this, but the following patch resolved the issue for me:


Inspector > replaceInspectorWithExplorer
"Switch to an explorer tool."
| window currentBounds |
self changed: #acceptChanges. "We copy the current state anyway. See below."
currentBounds := ToolBuilder default class getBoundsForWindow: self containingWindow.

"Close first because MVC fiddles around with processes."
+  self myDependents ifNil: [self myDependents: #()].
self changed: #close.
+  self myDependents ifNotNil: [
+  "View resisted to release, aborting"
+  ^ self].
self changed: #close.
window := ToolSet explore: self object.
"---- In MVC, the lines after this will not be executed ---"

window model setExpression: self expression.
ToolBuilder default class setBoundsForWindow: window to: currentBounds.


Hm, maybe we should extract this into Model >> #close ... see also the flag in Debugger >> #close for reference.
(And thinking more generally, I would like to move the whole logic somewhere into the UIManager/ToolBuilder. But that's stuff for another refactoring :-))

Best,
Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Stéphane Rollandin <lecteur at zogotounga.net>
Gesendet: Samstag, 18. April 2020 00:58 Uhr
An: squeak-dev at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] Please try out | Inspector Refactoring =)

> *2. Custom Fields*
>
> You can now add custom fields during your inspector session. Invoke the
> field-list menu and choose "add field..." at the bottom.

If, after having added a field, one swaps to the explorer via the
bottom-right button, a dialog appears warning that the field will be
discarded. This dialog has a 'yes' and a 'no' button, but both lead to
the same behavior: the explorer is installed.

Stef

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200417/7469dbd3/attachment-0001.html>


More information about the Squeak-dev mailing list