Bug in RebGUI table widget?
[1/1] from: rudolf::meijer::telenet::be at: 25-Mar-2008 19:46
I may have stumbled on a bug in RebGUI's <table> widget. I am building a GUI
for SOFTINNOV's mysql-protocol. When the user selects a MySQL table I want
to display its contents in a <table> widget. This should have as many
columns as the MySQL table has "fields" (also called columns in MySQL). The
point here is that I need to set the number of columns in the <table> on the
fly. There is an accessor function <set-columns> for that purpose. However,
after changing the columns, the action of clicking the column header (which
should result in sorting the table by that column) gives a run-time error on
the execution of the folowing code: <sort/skip/compare parent-face/data cols
col> (line 294 in the TRAC version of the code, see
http://trac.geekisp.com/rebgui/browser/widgets/table.r#L294). It appears
that the variables <cols> and/or <col> are not correctly set after
<set-column> is called. The script below will provoke the error.
Rudolf W. MEIJER
REBOL []
do %rebgui.r
window: make block! [
panel -1x-1 data [
tb: table 100x40 options [
"col-1" 'right 0.33 "col-2" 'right 0.33 "col-3"
'right 0.33
] data [1 2 3 4 5 6]
return
button -1 "Set-columns" [
tb/remove-row [1 2]
tb/set-columns ["col-1" 'right 0.5 "col-2" 'right
0.5]
tb/add-row [7 8 9 10]
]
button "Exit" [quit]
]
]
display "Test RebGUI table" window
do-events