morpic mystries

Herbert König herbertkoenig at gmx.net
Thu Apr 7 12:18:16 UTC 2005


Hello Squeakers,

pilfering from TestRunner's openAsMorph (squeak 3.6) I want to build
some UI, which by now only has one PluggableButtonMorph button.

As I want to change this button's label later on I made it an instance
variable of my application instead of a temp in my apps openAsMorph.

Problem is: the button ignores the setting of the colour and comes up
with Color transparent, though it accepts a new colour from from a workspace.

Some Code:
In a workspace:
app := FilesSynchronizedApp new
app openAsMorph
app firstPathButton color: app firstPathButtonColor.

This changes my button's color to green but it should be green already
as openAsMorph below already does this.

openAsMorph
        "FilesSynchronizedApp new openAsMorph"
        "stolen from TestRunner"
        "=== create my instvars ==="
        self fileTrees: (DualFiletree new).
        "=== build the parts ... ==="
        (self uiWindow: (SystemWindow labelled: self windowLabel)).
        self uiWindow model: self fileTrees.
        self firstPathButton: (PluggableButtonMorph
                                on: self
                                getState: nil
                                action: #getFirstPath
                                label: #firstPathButtonLabel).
                                
"================ the following line is ignored Why??? =============="

        self firstPathButton color: self firstPathButtonColor.
        self firstPathButton onColor: self firstPathButtonColor offColor: self firstPathButtonColor.


        "=== assemble the whole ... ==="
        uiWindow addMorph: self firstPathButton frame: (0.0 @ 0.0 extent: 1.0 @ 0.2).

        "=== open it ... ==="
        uiWindow openInWorldExtent: 400 @ 200.
"        self refreshWindow.  don't have this method yet"
        ^ uiWindow                


Best regards,

Herbert                          mailto:herbertkoenig at gmx.net




More information about the Squeak-dev mailing list