추가(또는 재구축)하기 전에 b를 지워야 합니다.
예를 들어 추가하기 전에 비어 있는 것으로 설정할 수 있습니다.
Button Box( "BE", b << set items({}); b << append( runScriptFilter( "BE" ) ) ),runScriptFilter = Function( {filterWord},
{},
If( filterWord == "FE",
selected = {"1", "2", "3"}
);
If( filterWord == "SSAFI",
selected = {"4", "5", "6"}
);
If( filterWord == "BE",
selected = {"7", "8", "9"}
);
Return( selected );
);
//title and gui
lub1 = Lineup Box( N Col( 3 ), spacing( 5 ),
Spacer Box( size( 0, 0 ) ),
Spacer Box( size( 0, 0 ) ),
Spacer Box( size( 0, 0 ) ),
//button and text
Button Box( "BE", b << append( runScriptFilter( "BE" ) ) ),
Button Box( "SSAFI", b << append( runScriptFilter( "SSAFI" ) ) ),
Button Box( "FE", b << append( runScriptFilter( "FE" ) ) ),
//H Center Box( text = Text Box( "Select column that will compared with indicators" ) ),
b = List Box(),
b << Set height( 400 );
b << Set Width( 400 );
);
pb1 = Panel Box( "GM EOL", lub1 );
myWindow = New Window( "GM EOL", Show Menu( 0 ), show toolbars( 0 ), Border Box( Top( 20 ), Bottom( 20 ), Left( 20 ), Right( 20 ) ), pb1 );
약간 단순화한 스크립트가 있습니다.
추가는 훌륭하게 작동하지만 목록을 추가하기 전에 현재 상태를 지우고 싶습니다.
모든 버튼을 클릭하면 다음과 같이 표시됩니다.

하지만 실제로는 9가 아닌 3개의 숫자만 제공하기를 원합니다(마지막으로 클릭한 버튼).