I'm using col boxes inside of table boxes to contain buttons. Very convenient way to have buttons, checkboxes, etc. inside a grid. The problem I'm having is that when I go to refresh the tablebox with new values the col boxes stubbornly hold on to their old values.
The code below demonstrates the behavior:
old_nr = 0;
nw = new window("Test col box removal",
hlistbox(,
textbox("Enter # rows: "),
neb = number edit box(),
),
button box("Refresh rows",
for (i = old_nr, i > 0, i--,
tbl_box << delete row(i);
);
c1_list = {};
n1_list = {};
cb_list = {};
nr = neb << get;
old_nr = nr;
for (i = 1, i <= nr, i++,
c1_list[i] = char(i);
n1_list[i] = i;
cb << append(button box(char(i)));
);
c1 << set values(c1_list);
n1 << set(n1_list);
),
tbl_box = table box(
c1 = string col box("C1", {}),
n1 = number col box("N1", {}),
cb = col box("CB", {}),
),
);