What options do I have to enumerate through the client properties dictionary? I’d like to be able to copy all the client properties from one window to another (where I may not know the property names ahead of time).
I think I can solve this by either 1.) Using a client property containing a list of relevant property names or 2.) Always using a single known client property, but it seems like there should be a way to list the dictionary keys directly.
There’s a private .getClientProperties() you could try to access from reflection. However, the comments on the documentation for .putClientProperty() pretty clearly encourage you to not go wild with these. I always use a static key for any repeatable purpose. I would examine your use-case to make the property names consistent/known.
{newMethod: def newMethod(self):
"""
Arguments:
self: A reference to the component instance this method is invoked on. This argument
is automatic and should not be specified when invoking this method.
"""
# A custom method.
pass}
I don’t know why someone would want to programmatically add custom methods, but if you want to the tools are here.