You could just manually make the okay button and click it with btn << Click.
InputWindow = New Window( "Pick a file opening option (must be truncated)",
<<modal,
V List Box(
Text Box( "Pick a Cut and Truncated Waveform" ),
Spacer Box( size( 1, 10 ) ),
Button Box( "Open a file",
path = Pick File(
"Select Raw Waveform data",
"", // no default directory
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"" // no default file
);
dt = Open( path ); //probably should do this instead of current data table()
//dt = Current Data Table();
btn_ok << Click;
),
Spacer Box( size( 10, 1 ) ),
Button Box( "Select from a list",
choose_data_table = Function( {},
list = {};
For( i = 1, i <= N Table(), i++,
list[i] = Data Table( i ) << get name
);
win = New Window( "Select a data table",
<<Modal,
hb = H List Box(
Panel Box( "Choose a data table",
dt = List Box(
list,
max selected( 1 ),
chosen = Data Table( (dt << get selected)[1] );
Show( chosen );
)
),
)
);
chosen;
);
dt = choose_data_table();
btn_ok << Click;
),
btn_ok = Buttonbox("OK")
)
);
But it sounds like you might not need a modal dialog. You could just have the rest of your code execution be a function or expression and send that to each button.
domorestuff = function({},
print(dt);
);
InputWindow = New Window( "Pick a file opening option (must be truncated)",
V List Box(
Text Box( "Pick a Cut and Truncated Waveform" ),
Spacer Box( size( 1, 10 ) ),
Button Box( "Open a file",
path = Pick File(
"Select Raw Waveform data",
"", // no default directory
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"" // no default file
);
dt = Open( path ); //probably should do this instead of current data table()
//dt = Current Data Table();
domorestuff();
),
Spacer Box( size( 10, 1 ) ),
Button Box( "Select from a list",
choose_data_table = Function( {},
list = {};
For( i = 1, i <= N Table(), i++,
list[i] = Data Table( i ) << get name
);
win = New Window( "Select a data table",
<<Modal,
hb = H List Box(
Panel Box( "Choose a data table",
dt = List Box(
list,
max selected( 1 ),
chosen = Data Table( (dt << get selected)[1] );
Show( chosen );
)
),
)
);
chosen;
);
dt = choose_data_table();
domorestuff();
)
)
);