LogoLogo
FeaturesHelp & ResourcesShowcasePricingLogin
Squirrel Addon Documentation
Squirrel Addon Documentation
  • README
  • Table of contents
  • Building an addon
    • Communication
    • Property Panel
      • Property Panel Elements
        • Accordion
        • Checkbox
        • Color Input
        • Conditional Logic
        • Dropdown
        • Font
        • Horizontal Line
        • Input Box
        • Radio Button
        • Series
        • Sub Accordion
        • Text Label
    • Publishing an addon
      • Restricting private addons
      • The review process
      • Add-on submission
        • Icon guidelines
        • Image guidelines
  • introduction
    • Joining the Developer Program
  • past-events
    • Building your first add-on
  • squirrel-helper-library
    • Dot notation
    • Angular
      • Classes
        • SquirrelCanvas
        • SquirrelColor
        • SquirrelMessage
        • SquirrelPosition
        • SquirrelSize
      • Events
        • onInitState
        • onPropertyChange
        • onPropertyChangesComplete
        • onSetCanvas
        • onSetPosition
        • onSetRuntimeMode
        • onSetSize
      • Getting Started
        • Building your first addon
        • Debugging
        • Sending and Receiving Data
        • The JSON files
      • Methods
        • getBindingDimension
        • getCanvas
        • getCopyOfState
        • getGenericProperty
        • getPosition
        • getRuntimeMode
        • getSize
        • initWithSquirrel
        • parseColor
        • sendToSquirrel
        • setPosition
        • setSize
        • shadeColor
        • tintColor
    • JavaScript
      • Classes
        • SquirrelCanvas
        • SquirrelColor
        • SquirrelMessage
        • SquirrelPosition
        • SquirrelSize
      • Events
        • onInitState
        • onPropertyChange
        • onPropertyChangesComplete
        • onSetCanvas
        • onSetPosition
        • onSetRuntimeMode
        • onSetSize
      • Getting Started
        • Building your first add-on
        • Debugging
        • Sending and Receiving Data
        • The JSON files
      • Methods
        • getBindingDimension
        • getCanvas
        • getCopyOfState
        • getGenericProperty
        • getPosition
        • getRuntimeMode
        • getSize
        • initWithSquirrel
        • parseColor
        • sendToSquirrel
        • setPosition
        • setSize
        • shadeColor
        • tintColor
    • React
      • Coming Soon
Powered by GitBook
LogoLogo

Explore

  • Home
  • Features
  • Pricing
  • Download Squirrel

Help

  • Learn
  • Community
  • Support
  • FAQ's

Updates

  • Blog
  • Events
  • Release Notes

Company

  • Contact Us
  • Privacy Policy
  • Terms of Use

Copyright © 2019 - 2024 InfoSol Ltd. All rights reserved.

On this page
  • initWithSquirrel()
  • state
  • bindingDimensions

Was this helpful?

  1. squirrel-helper-library
  2. JavaScript
  3. Methods

initWithSquirrel

initWithSquirrel();

PreviousgetSizeNextparseColor

Last updated 3 years ago

Was this helpful?

initWithSquirrel()

No parameters and no return.

This method should be called once the addon has finished it’s own configuration and initialization. This will send a message to Squirrel to inform it that the addon is setup and ready to start sending and receiving messages.

This method will store a copy of state and bindingDimensions.

state

Squirrel will respond to the method call with a handshake response. The handshake will include a complete copy of state.

State matches the structure provided in the file. The state object passed from Squirrel will contain all the current values for any bound cells or hard-coded values in the property panel.

State is a private variable which you cannot access directly, however you can request a copy of state by using the method. And a copy of state is passed into the method.

{
  "buttonText": "Load File",
  "buttonDisabled": "false",
  "buttonColor": {
    "type": "solid",
    "color": [
      {
        "color": "#22ee33",
        "alpha": 1,
        "ratio": 0
      }
    ],
    "rotation": 0,
    "enabled": true
  },
  "dataDestination": ""
}

bindingDimensions

Squirrel will respond to the method call with a handshake response. The handshake will include a complete copy of all the known bindings.

The bindingDimensions object will contain a property name matching your default state, following , with the value being the size of the binding.

This variable is private and not directly accessibly, however you can get the dimension for a specific property by calling the method

{
  "buttonColor.color.0.color":{
    "width":1,
    "height":1
  },
  "buttonText":{
    "width":1,
    "height":1
  }
}

getCopyOfState()
onInitState
dot notation
getBindingDimension
initWithSquirrel()
initWithSquirrel()
defaultState
defaultState.json