Inspector with attributes that depend on each other (like filtergraph~)

For a UI object I am working on, I need to have attributes that depend on each other. Much like filtergraph~, where changing the value for Active Filter(s) changes the number of items in the Currently Selected Filter popup, and changing the latter updates the Filter Type.

This presumably makes use of object notification. The documentation here leaves some questions open… is there any source code available on how to do this sort of thing? Sample code would be a big help.

filtergraph~ uses attributes with custom setters and gettrs to set and get the value of specific filter parameters depending on the state of other attributes. Changing active filters only changes the number of items in the enum values for the other edit_filter attribute. Is that what you need to achieve?

For the rest, it’s all done with the custom get/set methods. So when you change the current filter, you set the values of the edit_whatever attributes (using object_attr_setvalueof to notify the attributes so the inspector redraws, not by accessing directly to their values in the object structure). Hope this makes sense.