Multi-level Event Handling
Multi-level Event Handling (Meh :-) is my Ruby-centric approach
to handling user events.
Relying on the speed of SketchUp's communication protocols,
Meh relies heavily on jQuery
and jQuery UI
Any user activity which could affect the behavior of the plugin
(eg, clicking a checkbox or a button)
is forwarded to an appropriate Ruby callback.
These are divided into two categories:
- Actions, typically tied to links or buttons, cause the plugin to do something.
- Updates, typically tied to checkboxes, radio buttons, tabs, or text areas, cause the plugin to record the new setting (eg, in a hash). In some cases (eg, tabs), they may also cause the plugin to perform an action (eg, call
execute_script to add content to the tab).
This approach is used in all of my plugins that use WebDialogs, eg:
- CFCL/Public: Draw Ruby 2 (ERb), Model Viewer
- Igloo/Public: Product Editor, Report Maker
This wiki page is maintained by Rich Morin
an independent consultant specializing in software design, development, and documentation.
Please feel free to email
comments, inquiries, suggestions, etc!