[Newbies] RE: How to reopen a collapsed Morph from another Morph?

Fredrik Alink falink at free.fr
Sat Aug 15 10:21:52 UTC 2015


Ron Teitelbaum wrote
> Could you post more details like example code that shows the error, and
> maybe a picture of what you are seeing?

<http://forum.world.st/file/n4843032/SQ.png> 

Code:

*Class hierarchy:*

Morph
    BaseInterface
        MainConsole
        ModelConsole

*step 1:*

MainConsole new
    super initialize
(       <initialisations>
        self initScreenItemStates.
        self openWindow.
        self openInWorld.
        owner := self currentWorld)

The MainConsole shows up.

*Step 2:*

(MainConsole) demoButtonClicked
    self
        modelConsole: ((ModelConsole new) “init as in MainConsole”
            mainConsole: self;
            yourself);
        collapse.

The ModelConsole shows up, the MainConsole collapses.

*Step 3:*

(ModelConsole) xButtonClicked
    "close own Modelprocessor"
    self mainConsole isNil
        ifFalse: [
            "uncollapse MainConsole: remove and then reactivate"
            self mainConsole currentWorld removeMorph: (self mainConsole).
            self mainConsole openInWorld."
            "disconnect MainConsole"
            self mainConsole modelConsole: nil.
            self mainConsole: nil].
    "close ModelConsole"
    ^self currentWorld removeMorph: self

The MainConsole shows up, the ModelConsole disppears, but the collapsed
MainConsole stays visible on screen.

*Step 4:*

(MainConsole) exitButtonClicked
    self modelConsole isNil
        ifFalse: [self modelConsole exitButtonClickedInMainConsole].
    ^self currentWorld removeMorph: self

The MainConsole disappears, but the collapsed MainConsole stays visible on
screen. Deopending of the order you do the abov, it is still 1 time active,
otherwise it is dead. When deaad, it just disappears from the screen when
clicking on x, v, + or –.



--
View this message in context: http://forum.world.st/How-to-reopen-a-collapsed-Morph-from-another-Morph-tp4842627p4843032.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.


More information about the Beginners mailing list