Specify the behavior of hierarchical-list-compound-item<%>:open if its parent is not open
Open
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with racket -t hierlist-error.rkt -m, then inspect arrow-toggle-snip.rkt and hierlist-unit.rkt at the stack-trace locations. Confirm the intended state transition for opening a child whose parent is closed, and verify that opening the parent later reflects that state without raising the reported exception.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100