Can getControlByName use relative path?

I have a rather complex GUI structure. When I want to add such like click event to a button, I must use getControlByName firstly to get the button. But when the GUI get more and more complex, I have to name the GUI element with a globally unique name which is very inconvenient. For example, I must name like this "close A button, “close B button” instead of just “close”,“close”.

I assume you are talking about an HTML-style query selector kind of control-getter. We don’t have something like that. Programmatically naming your buttons would be the right way to go here. We also have the member uniqueId that provides you with an immutable number that you can use for future reference. You can create a map yourself with the unique IDs inside the tree structure of your choice, and then query using the ID or name