When I instantiate a Pane, I use backgroundColor
var pane = new Pane({
width: 200,
height: 100,
backgroundColor: "#ff0000",
}).reg(CENTER);
But later if I want to use the same pane with a different color I can't use
pane.backgroundColor
but I have to use
pane.backing.color
This is not intuitive !
I should be able to use
pane.backgroundColor
1 Like
In an ideal world, perhaps. We do it case-by-case which we realize is not consistent, but saves size in the ZIM code. There are many cases where there a property is not available that matches a parameter. If the solution can come from accessing a ZIM object inside the component, like in the Pane() example, we then let coders figure that out.
We do take requests for missing properties. And then look at how often someone would change the color of the Pane, etc. All this is open for discussion too... so will leave the message active if anyone else wants to join in.
We will give the backgroundColor of the Pane some thought.
2 Likes
Or may be some way to make it easier to figure out such properties in the help doc.
Yes - in the parameter information we can say to change this afterwards, use the background property. Etc. If you look at properties, it will say there is access to the backing property... we can add it there too. Thanks.
This has been adjusted for ZIM Pane()
We will keep an eye out for other similar opportunities.
1 Like
also make backDropColor possible within the properties.. or a note how to change that to clear!
Would you change a backdrop after you make it - it seems less likely.
I used red and green depending upon the error and success in a game app.
I think instantiating the Pane each and every time would not be efficient.
And in such cases instantiation needs to be followed by, reusing the same instance again and again with whatever new changes required as per the situation.
Yes - I understand why one would want to change the pane backing color - but I don't think we would need to change the backdrop color - that is the darkening of the rest of the stage. So, not adding extra instructions for that. Have added the extra instructions for the backing color.