Skip to content

Commit 83f0c40

Browse files
jjsimpsomflatt
authored andcommitted
don't set list-box% content when set-string given column > 0
- calling set-string with a column argument other than 0 overwrites content, which doesn't appear to store any data other than the string to display in column 0. this breaks future calls to get-string.
1 parent ff003fb commit 83f0c40

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

gui-lib/mred/private/mritem.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,8 @@
903903
(sub1 num-columns)
904904
#f)))
905905
(check-item 'set-string n)
906-
(send this -set-list-string n d)
906+
(when (= col 0)
907+
(send this -set-list-string n d))
907908
(send wx set-string n d col)))]
908909
[set-data (entry-point (lambda (n d) (check-item 'set-data n) (send wx set-data n d)))]
909910
[get-first-visible-item (entry-point (lambda () (send wx get-first-item)))]

gui-test/tests/gracket/windowing.rktl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,9 @@
875875
(st '(0 1) l get-column-order)
876876
(stv l set-column-order '(1 0))
877877
(st '(1 0) l get-column-order)
878+
(define old (send l get-string 0))
878879
(stv l set-string 0 "A2" 1)
880+
(st old l get-string 0)
879881
(check-col-width 1)
880882
(stv l append-column "Three")
881883
(check-col-width 2)

0 commit comments

Comments
 (0)