// Open Data Table
dt = Open( "$SAMPLE_DATA/Growth Measurements.jmp", invisible );
f = Function( {a}, teb<<settext(char(nitems(dt<<getselectedrows)) ));
rs = dt << make row state handler( f );
New window("", Modal, <<onclose(rs=0;1),
tb = Textbox("Rows selected"),teb= text editbox(""),
Vlistbox(
gb = dt << Graph Builder(
Size( 522, 452 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Graph Spacing( 8 ),
Variables( X( :Age ), Y( :Growth ),Group X( :Growth ), Overlay( :Subject ) ),
Elements( Line( X, Y, Legend( 13 ) ) )
);));
The onclose script clears the handler when the window is closed so it won't make log messages about the missing TextEditBox, AND it returns 1, which allows the window to close.
Craige