All,
I have a script with function that creates a GraphBuilder. It then gets packed into display boxes and put into a new window. Somehow, commands to change FrameBox size from within the function are ignored, and I can only change it when window is created. Why is that? I'd like this functionality to be inside the function, so that it outputs a plot that does not need any additional tinkering with. Changing title works from within the function, why not changing size?
Here's an example with 3 different attempts to change FrameBox size - only the third one works.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
X_Parameter = "height";
Y_Parameter = "weight";
groupColumn = "sex";
titleText = "Example";
GBfunction= Function( {dt, X_parameter, Y_Parameter, groupByColumnString, titleText = ""},
groupByColumn = Column( dt, groupByColumnString );
cb = Context Box(
gb = Graph Builder(
Size( 350, 600 ),
Ignore Platform Preferences( 1 ),
Show Control Panel( 0 ),
Variables( X( Column( X_Parameter ) ), Y( Column( Y_Parameter ) ), Overlay( groupByColumn ) ),
);
rgb = gb << Report;
(rgbOB = ((rgb << XPath( "//OutlineBox[@helpKey = 'Graph Builder']" ))[1])) << Set Title( titleText );
//Attempt #1
(rgb << XPath( "(//OutlineBox//FrameBox)" )) << Frame Size( 350, 200 );
//Attempt #2
//(rgbOB << XPath( "//FrameBox" )) << Frame Size( 350, 200 );
);
Return( cb );
);
lub = Lineup Box( N Col( 3 ) );
lub << Append( GBfunction( dt, X_Parameter, Y_Parameter, groupColumn, titleText ) );
ob_group = Outline Box( "GB Function example: " || (dt << Get Name) );
ob_group << Append( lub );
nw = New Window( (dt << get name), ob_group );
//Attempt #3
rgb = ob_group << XPath( "//OutlineBox[@helpKey='Graph Builder']" );
//(rgb << XPath( "(//OutlineBox//FrameBox)" )) << Frame Size( 350, 200 );