123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::OptionsProviderObserver Abstract

Relationships
Inherits: Object

Overview

This class is abstract.

To implement this observer, create a Ruby class of this type, override the desired methods, and add an instance of the observer to the objects of interests.

This observer interface is implemented to react to operations provider events. What this means is that you can watch as the user changes SketchUp options and react to them. The following Sketchup::OptionsProviders are defined in the API:

  • "UnitsOptions"

  • "PrintOptions"

  • "PageOptions"

  • "SlideshowOptions"

  • "NamedOptions"

Each of these has a list of specific options that the user can set. See the OptionsManager and OptionsProvider classes for more details.

Examples:

class MyOptionsProviderObserver < Sketchup::OptionsProviderObserver
  def onOptionsProviderChanged(provider, name)
    puts "onOptionsProviderChanged: #{name}"
  end
end

# Detect when the end user changes their units settings.
options_provider = Sketchup.active_model.options["UnitsOptions"]
options_provider.add_observer(MyOptionsProviderObserver.new)

Version:

  • SketchUp 6.0

Instance Method Summary

Instance Method Details

#onOptionsProviderChanged(provider, name) ⇒ nil

The #onOptionsProviderChanged method is invoked when a property of an OptionsProvider changes.

Examples:

def onOptionsProviderChanged(provider, name)
  puts "onOptionsProviderChanged: #{name}"
end

Parameters:

Version:

  • SketchUp 6.0