User Guide

Ruby Component
getViewSize connectorReference
You need to pass the index of the View connector that you want to query (or you can leave it blank and zero will be assumed). The method
returns a two element array containing the width and height. In the example below we've pressed the trigger button and the event method
has been called triggering the call to getViewSize and the result is then displayed in the watch list.
If you don't have a View connected then the call to getViewSize will return nil. This can happen when you have no link connected or during
loading or init so if you intend to use getViewSize in loading or init methods it's best to check whether the result is nil before acting on it.
Changing The View
So far we've been working with a View that has a fixed size and position. But what if you wanted to change that? What if you wanted to
expand the view, move its position in the parent front panel or even hide it?
Well, you can do that using the setViewSize and setShowInParent methods.
The setViewSize method takes an array of the form [x,y,width,height] (you can also supply an initial parameter to define the index of the
input connector you want to connect through).
The x,y part defines the location of the top-left corner of the view in its parent panel and the width and height parameters define the size.
The setShowInParent method takes a boolean parameter which specifies whether the view is to be shown in the parent panel or not (once
again, you can also supply an initial parameter to define the index of the input connector you want to connect through).
128 of 212