[RESOLVED] Dynamic access of object properties
(continued from this thread)
I'm looking for a clean way to set an object's properties without knowing ahead of time what kind of object it is or what the properties will be. For example, the object may be a VBox or HBox, in which case I will be setting height, width, border effects, etc, or it may be a TextField, in which case I will be setting font, fontsize, etc.
I could spend lines and lines of code defining what properties to expect for what objects (not looking forward to that), but I was wondering if there is a dynamic way to handle this. For example, the XML object has an attribute array that contains the attribute names and values for a particular node. You can use the following to dynamically set those attributes:
Code:
myXML["id"] = "node1";
Is there something similar for objects, i.e.:
Code:
myVBox["height"] = 150;
?