List-box class needs rewrite
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
The list-box class needs a re-write in a bad way.
Required fields

Instantiating a list-box should not require you to define choices for the list-box. It should be optional, so that the user can populate it when they are ready. This is basic Object-oriented thinking. The list-box could be very useful for presenting search results to a user for selection, but doing so is miserable. For a work-around, I had to use an empty string to initiliaze the choices, keeping the list-box hidden, then use the set method with empty lists (send blah set (list ) (list )) to clear it out before showing the list-box and populating the fields.
Set method

Also, the set method is dumb, because it clears the list for no reason. This makes no sense at all. It makes this function completely useless for typical use-cases of list-box.
Append

Also, the append method does not allow populating all fields when adding a new entry, if there is more than 1 column to populate. This is a weird limitation. As a work-around, I had to first populate the new list item's first column with append and then populate the remainder of the fields using set-string. This is not intuitive at all. Also, the [data] field is confusing. People who are making GUIs will read that to mean "the data I want displayed will go here". This is a bad name for that field. In this context, you cannot use "data" to describe something that is not visible. Try something unused like "arb" You can define an arb data type as "arbitrary data" in another doc entry. This will resolve the conflict between the user's definition of "data" and Racket's definition.
The right way:
- Make choices optional.
- Get rid of the
setfunction (replaced by append below) - Provide essential methods:
append
Creates a new row. Takes a list of strings and a list of arbitraries. Assigns each string to a corresponding field in the row.(send a-list-box append (list* field1 field2 field3 ...) [(list* arb1 arb2 arb3 ...)]
Appends a list of string-lists (a 2D array), so the user can add(send a-list-box append (list* (list* field1 field2 field3 ...) (list* field1 field2 field3 ...) . . . ) [(list* (list* arb1 arb2 arb3 ...) (list* arb1 arb2 arb3 ...) . . . )])nnew entries to the list.insert
where(send a-list-box insert (blah))blahis the same kind of structure shown above inappend.clear- clear the contents.(send a-list-box clear)
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
Start with the list-box class and its documented set, append, and data interfaces, using the linked list-box documentation. Compare the current behavior with the requested optional choices, row insertion and population, clearing, and naming changes; done would require an agreed API redesign plus implementation and validation.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100