I am trying to understand what you mean. Since I'm talking about 2
concurrent Morphs, I implemented your remarks like this:


MainConsole demoButtonClicked
        morph := ModelConsole new.
        self modelConsole: morph. "handshake"
        collapsedMorph := self myPackageCollapse.
        morph mainConsole: self. "handshake"
        morph collapsedConsole: collapsedMorph. "handshake"

ModelConsole xButtonClicked
        | collapsedMorph expandedMorph |
        "close all running Modelprocessors"
        "  to be defined!  "
        "close own Modelprocessor"
        self mainConsole isNil
                ifFalse: [
                        expandedMorph := self mainConsole.
                        collapsedMorph := self collapsedConsole.
                        "uncollapse MainConsole"
                        collapsedMorph collapseOrExpand.
                        "release handshakes"
                        expandedMorph modelConsole: nil.
                        self mainConsole: nil].
        "Close ModelConsole"
        ^self currentWorld removeMorph: self

This really solves the problem, *except* for the following situation:
Step 1: open the MainConsole
Step 2: MainConsole > demoButtonClicked: the ModelConsole opens, the
MainConsole collapses
*Step 3*: click on the - sign of the collapsed MainConsole to uncollapse it
*Step 4*: MainConsole > minimizeButtonClicked: to collapse it again
Step 5: ModelConsole > xButtonClicked: the ModelConsole closes, the
MainConsole opens, *but* an artefact of the collapsed MainConsole stays on
the screen.
.....
Step 6: click on the - sign of the artefact and it disappears .....
Step 7: MainConsole > exitButtonClicked: the MainConsole closes.
..... or:
Step 6: MainConsole > exitButtonClicked: the MainConsole closes but the
artefact stays *as active *MainConsole
Step 7: click on the - sign of the collapsed MainConsole to uncollapse it
Step 8: MainConsole > exitButtonClicked: the MainConsole closes.

Were:
MainConsole > exitButtonClicked
        ^self currentWorld removeMorph: self

and:
MainConsole > minimizeButtonClicked
        ^self collapse

So, much better but not perfect ......



Hi,

It's hard to tell what is wrong without interacting with your code. If you can put your code to SqueakSource3 then I or someone else might be able to help you. The only suggestion that comes to my mind by looking at the example above is that you can not only remove your console morph, but also the CollapsedMorph. Besides that, imho it's better to use the self delete, than to do things like self currentWorld removeMorph: self. In this way you can just do: morph delete. collapsedMorph delete. Nevertheless it's just a wild guess and I cannot tell anything without interacting with your app.

Best wishes,
Mateusz

_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to