there is NO **Sketchup::StylesObserver**
But the Styles class has a few 'observer-like' methods:
Styles.update_selected_style
This method is a boolean method (which should have a '?' at the end of it's name.) The use of this method is confusing (partly as the example does not show the style being selected.)
Styles.active_style_changed
(again, should have a '?' at the end of it's name.)
This is a session boolean, changes anytime after saving; but no way to trigger an event.
Would it be better to create a StylesObserver class?
That had methods such as:
--- (edit) names changed
onStyleSetAdd(styles, newStyle)
onStyleSetCreate(styles, newStyle, fromStyle)
onStyleSetChosen(styles, oldStyle, newStyle)
--- (edit) name added
onStyleSetRename(styles, style, oldName, newName)
onStyleSetRedescribe(styles, style, oldText, newText)
onStyleSetEdited(styles, style, styleOptions, optionsChangedHash)
(for Bulk handling instead of single option handling.)
Purge methods
(as in previous post (Suggested) onBeforePurge & onAfterPurge)
onBeforePurge(styles, stylesUnusedObjectArray)
onAfterPurge(styles, removedStylesArray, purgeResult)
--- (edit) the following withdrawn
onStyleEdit(styles, style, option, oldValue, newValue)
*****
- probably will need to implement a "StylesOptions"
OptionsProvider
-- in favor of updates to
RenderingOptionsObserver
as in post:
Re: StyleOptions / StyleOptionsObserver