gui
gui copied to clipboard
Specify the behavior of hierarchical-list-compound-item<%>:open if its parent is not open
Version
Racket 7.4 on Debian 9.
How to reproduce
Save this in hierlist-error.rkt:
#lang racket/base
;; hierlist-error.rkt
(require
racket/class
racket/gui/base
mrlib/hierlist
)
(provide
main
)
(define (main)
(define frame (new frame% [label "hierlist-error.rkt"] [width 800] [height 600]))
(define hlist (new hierarchical-list% [parent frame]))
(define hcompound-1 (send hlist new-list))
(define hcompound-1-1 (send hcompound-1 new-list))
;; This throws an exception.
(send hcompound-1-1 open)
(send frame show #t)
)
Then, run:
racket -t hierlist-error.rkt -m
We get this NullPointerException:
end: target is not an object
target: #f
method name: get-text-extent
context...:
racket-7.4/share/pkgs/gui-lib/mrlib/arrow-toggle-snip.rkt:161:4: set-state method in arrow-toggle-snip%
racket-7.4/share/pkgs/gui-lib/mrlib/hierlist/hierlist-unit.rkt:479:13: handle-open method in hierarchical-list-snip%
Expected behavior
I expect hcompound-1-1 to change its internal state to open, so that when its parent is opened, it will be open by default.