Class: Sketchup::OptionsProviderObserver Abstract

Inherits:
Object
  • Object
show all

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 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 # collapse

Instance Method Details

#onOptionsProviderChanged(provider, name) ⇒ nil

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

Examples:

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

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0