I’m trying to set a constructor method on my subclass PushButton and it got overridden by Public properties…
I can’t use Open event, i use it all around the app.
The strange thing is :
if i do windowXYZ.show
the subclassPushbutton’s constructor works fine
but if i do
w as a new windowXYZ(someparam)
the subclasspushbutton’s constructor got overriden by the public properties…
how can i work around that ?
PS : no open event ! it’s already in use in sooooo many button
When you place an instance of a control on a layout (a window) it gets a set of values (not so much properties as those are defined by the super)
This way each instance can have its own values for the different properties - controls would be kind of useless if you could not have buttons with different captions etc
Then, at runtime, when you show the layout (or construct one) the framework constructs the layout and then basically for each control executes code that is analogous to
thisNewControl = new <Control of whatever type>
thisControl.setallyourproperties
so anything in the constructor that sets a property may just get overwritten when the controls properties are set to the values from the layout
This has been true forever (literally) - and isn’t considered a bug FWIW