I have a custom canvas customCan. It had a property ZoomFactor as integer which was set to 3.
As the project developed I changed ZoomFactor to a computed property. I also set its default value to 5.
In a window I have a canvas, and its super is set to customCan. It could be (can’t remember but it seems likely) that originally it just had a super of Canvas and a property ZoomFactor with default 3, and that the property was moved to the custom class.
When I run the project and follow it in the debugger I see that ZoomFactor is 5 in the customCan constructor, then it goes to the Window constructor and ZoomFactor is suddenly 3.
I searched but absolutely nowhere in the project do I still have a 3, or set the ZoomFactor to 3.
Opening the project in ARBED I see that the instance (?) on the window has a property ZoomFactor = 3 which is NOT shown in the IDE.
I can’t delete it in ARBED, but I can set it to 5.
P.S. Will see if I can reliably do this in a small sample project and submit a bug report. Or does anyone know of one already?
Such a default value is read once from the subclass, and that is when the instance is created on the window. So you will need to delete the instance on the window and create a new one, then the change of the default value in your subclass will show.
Made a completely new canvas in the old non-corrected project, set its super to customCan, and following in the debugger.
It to shows a value of 5 for ZoomFactor in the customCan constructor which went to 3 in the window constructor.
I looked at the property list behaviour of customCan: there is a property ZoomFactor listed with a value of 3, not the value of 5 as specified in the IDE.
I open the version corrected by ARBED. It runs with a ZoomFactor of 5, and I expected to see this in the property list as well, but when I check the property list behaviour of customCan the ZoomFactor there is stated as being 3.