Spacer Boxes are very handy for controlling space in a window. Try this:
dt = New Table( "TestTable",
Add Rows( 2 ),
New Column( "x", Numeric, "Continuous", Format( "Best", 6 ), Set Values( [2, 4] ) ),
New Column( "y", Numeric, "Continuous", Format( "Best", 6 ), Set Values( [3, 5] ) ),
New Column( "Cat", Character, "Nominal", Set Values( {"short", "a very long category"} ) )
);
HBox = H List Box(
V List Box(
Spacer Box(size(560, 0)),
dt << Graph Builder(
Size( 390, 368 ),
Show Control Panel( 0 ),
Variables( X( :x ), Y( :y ), Overlay( :Cat ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
)
),
filter = dt << Data Filter(
Mode( Show( 1 ), Include( 1 ) ),
Add Filter(
columns( :Cat, ),
Display( :Cat, "Check Box Display" ),
)
)
);
NW = New Window( "Example", <<show window( 1 ), HBox );
It creates a spacer box just above the graph builder. If the graph builder box goes below the width of the spacer box, the Data Filter will not move. However, if you interactively make the graph builder box bigger, you will again see the behavior you are currently experiencing.
To better see what the spacer box is doing for you, try replacing it with this one:
Spacer Box(size(560, 10), Color("yellow"))