morpic mystries

Hernan Tylim htylim at yahoo.com.ar
Fri Apr 8 11:12:10 UTC 2005


Herbert König wrote:

>Hello Joern,
>
>JE> the color is reset when adding the morph to the SystemWindow (see 
>SystemWindow>>>addMorph:fullFrame:) - don't know why
>
>JE> try to set the color after adding it, not before.
>
>thanks for your help, that works. What I do not understand is, why it
>also works the other way, when the button is a temp to the method and
>not an Instvar of the application.
>
>runButtonColor for example has no sender besides the single send in
>TestRunner's openAsMorph and TestRunner's buttons start up in green!
>
>I'm a baby squeaker but a grown up programmer (i guess :-))) and I
>hoped with smalltalk i would have to do less "programming around the
>problem".
>
>So maybe someone can enlighten me here.
>  
>

I don't know if I can provide enlightenment but, .... 
SystemWindow>>addMorph:fullFrame: change the colors of the added morph 
to preserve the SystemWindow color theme (there is a preference to turn 
this off, but I don't remenber the name right now). You can change the 
color of the button after you add it to the Windows, but that will not 
work if you afterwards change the SystemWindow color via the 
SystemWindow's menu option.

The expected way for you to doing what you need is to use an extra morph 
between the SystemWindow and your buttons, so this intermediate morph 
will be the one recolored and not your buttons. Conceptually think of 
this morph as a panel to hold widgets on a SystemWindow (This panel 
might hold many different buttons for example and layout them in row 
fashion, or whatever you like)

Regards,
Hernán




More information about the Squeak-dev mailing list