Not exactly sure why using one extra variable is required here (maybe it otherwise tries to resize the image in the table and cannot do it)
Names Default To Here(1);
dt = Current Data Table();
name_list = dt:name << get values;
num_list = dt:number << get values;
pic_list = dt:picture << get values;
nw = New Window("row",
V List Box(
tb = Text Box("some row"),
H List Box(
Panel Box("names & numbers",
V Scroll Box(
tbox = Table Box(String Col Box("Name", name_list), String Col Box("Number", num_list), )
)
),
Panel Box("pics",
pb = picture box()
)
)
)
);
tb << set font style("Italic") << font color("Dark Blue") << set font("Stencil", 16) << set width(450);
tbox << set underline headings(1) << set heading column borders(1) << set column borders(1) <<
set row borders(1) << set shade alternate rows(1) << set selectable rows(1);
tbox << set row change function(Function({this},
row_list = this << get selected rows;
If(N Rows(row_list) > 0,
k = row_list[1];
one_pic = pic_list[k];
pic = one_pic;
pic << Scale(0.2);
pb << set image(pic);
);
)
);
I don't generally use table scripts, but I think in cases like this using Current Data Table() should be fine. In some cases it might refer to wrong table (like if you immediately change table after running the table script) but most likely it isn't an issue here. Other option could be to just drop dt and current datatable() and just use :name, :number, :picture and hope table script knows to refer always the correct table (this might work better than using current data table() when you have simple table script like this).
-Jarmo