Expand/Shrink

Attributes

On the first reading, you should assume something like gdx button = gButton("button") and without worrying too much about the technical details of that, it should be obvious that it creates a button. Equally I am sure you can imagine a fairly long list of things you might want to alter: size, font, colour, text, an image, enable/disable it, and of course configure what happens when it is clicked.

All of that, even the handlers, is achieved through the use of attributes.

Note that IUP/pGUI allow bespoke application-specific attributes on any control, which are effectively ignored, however in particular xpGUI.js benefits enormously from flagging anything it does not [yet] understand, and likewise desktop/Phix is simply better if say "POSITON" is immediately called out as the typo that it is. So under xpGUI you will have to store such custom things elsewhere, or alternatively I could easily be persuaded to add, say, gG/SetCustomAttribute().