I don't think the problem is with the panel box specifically - you get the same problem is you remove the panel box.
It's the window itself that increases its size to accomodate the content.
The solution you propose therefore works if you apply the resizing to the window. However, once a window is resized it wont resize itself so you need to control the resize to make it larger as well as smaller.
This code seems to work ...
str = {"case 1: low dose really long description really long description really long description",
"case 2: high dose really long description really long description really long description"};
short_str = Eval List( {Left( str[1], 6 ), Left( str[2], 6 )} );
ss_small = {};
ss_large = {};
pb1 = Expr(
Border Box( ,
hlb1 = V List Box(
tb = Text Box( "Select Case" ),
cb = Check Box( short_str ),
vlb1 = V List Box(
Spacer Box(),
H List Box(
rb2 = Radio Box(
"Show name",
cb << delete;
vlb1 << prepend(
cb = Check Box(
short_str
)
);
nw << set window size(ss_small[1],ss_small[2])
),
rb1 = Radio Box(
"Show description",
cb << delete;
vlb1 << prepend( cb = Check Box( str ) );
If (NItems(ss_large)==0,
ss_large = nw << get window size
,
nw << set window size(ss_large[1],ss_large[2])
)
)
)
)
)
)
);
pb2 = Expr( Panel Box( , V List Box( Button Box( "Run" ), Button Box( "Cancel", <<close window ), Spacer Box() ) ) );
nw = New Window( "Example", hlb = H List Box( pb1, pb2 ) );
rb2 << group( rb1 );
ss_small = nw <<get window size;
Dave
-Dave