[Cuis-dev] CheckButtonMoprh and fillColor

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Aug 11 13:57:28 PDT 2024


On 2024-08-11 12:54, Mark Volkmann via Cuis-dev wrote:

> I'm struggling to understand the use of fillColor in CheckButtonMorph 
> after studying the code for an hour. For example:
> 
> cb := CheckButtonMorph new.
> cb fillColor: Color white.
> cb openInWorld.
> 
> This will display a checkbox with a black, rounded border filled with 
> white.
> If you hover over it, the fill color will change to gray.
> I see where that happens in the code. It is the border color with 50% 
> opacity.
> 
> If you move the mouse outside the checkbox, it will change to be filled 
> with black.
> Is this intended? I'm trying to find a way to get it to return to the 
> fill color I specified which is white.

Looking at the code, I see that fillColor is transitory -- it changes 
with the state of the CheckButtonMorph.

Perhaps try:

Feature require: 'UI-MetaProperties'.
CheckButtonMorph example1 openInWorld.

Use the "Change Scale" construction handle to make it bigger.
Then open the checkButtonMorph's menu and click the pushpin.
As you move the mouse in and out over the checkButton and click it to 
change its state, you will see the fillColor change.
Use the menu to change the #color and #borderColor to get what you want 
(e.g. color yellow, borderColor lime green).
Play with it a bit more to see how the checkButton is expected to work 
with mouseover & mouseup/click.

HTH,
-KenD





More information about the Cuis-dev mailing list