Canvas subclass and color property default value changing

I have created a subclass of Canvas with a color property and a default value.

After adding this subclass to a window and running the app the color property value changes to white. Any other property default value for a string or integer works fine but colors seems to change and I have to set the value again in the open event to make sure the correct is used.

Xojo 2018.r1 and Mac OS X 10.13.4 (not tested in Windows)

Does this also happen without Transparency ( Transparent = False)?

Yes.

There is no need to use the color in the Canvas, I have also tested displaying it as text in a label. All properties seems to remain as set by default except color.

But, If I instantiate a variable from this class ( vcanvas = new mycanvassubclass) then color property is also correct. The problem appears only if adding at the IDE.

And in the Debugger is the Color Property white?
Then i’d write a Feedback Request.

Have created feedback for this issue:

<https://xojo.com/issue/52361>

[quote=390071:@Alejandro Fresno Meyer]Have created feedback for this issue:

<https://xojo.com/issue/52361>[/quote]

This is not a bug. Please see:

http://developer.xojo.com/userguide/desktop-custom-controls

To override the default value for a control you need to use the Inspector behavior.

I don’t need Inspector behavior because I’m not changing this value at IDE and as far as I know this is the purpose of the Inspector but a property may have a default value even if it is a color.

I’m getting really weird results now: the color property (named BackColor) works correct after several executions but it doesn’t changes if I set a different color :D, it’s like having a cache for the default value between executions. Better I retry tomorrow :slight_smile: