Renaming isn't... real? Problem with any component blocks

@maxb I think I understand what you’re trying to do and it makes sense to me. There are a couple of upcoming features that should help you. One is a block which would return the name of a component. That would, presumably, let you do exactly what you described. The other is the ability to add your own properties to a component, so you could, for instance, add a food property on your buttons which could have a value of “pizza” or “hamburger”. That would allow you to name your buttons whatever you like but still distinguish them. It would also allow you to distinguish buttons (or other components) that you create dynamically via the Create or Clone blocks.

What @actech was describing was a way to work around the fact that the features I mentioned don’t exist yet. For example, if you set the TextColor property of your buttons to have the same value as your button’s name, you can use that property to distinguish your buttons. It works because invalid TextColor values don’t have any effect on the color but they are saved with the component. If you happen to want to actually use the TextColor property to change your button’s text color then you can use the BackgroundColor or BackgroundPicture property instead. Note that I can’t guarantee that invalid values will always work this way (e.g. we might decide that they are an error), so I would suggest that if you use this workaround that you create a function (called, say, “GetButtonName”) which takes a button component and returns the button’s name. For now, that function would return the value of the TextColor property of the button, but you could change it to return the actual name once that block is available.

Hope this helps.

-Mark

1 Like