Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListBox with list models #224

Open
5 tasks
danirabbit opened this issue Dec 13, 2024 · 0 comments
Open
5 tasks

ListBox with list models #224

danirabbit opened this issue Dec 13, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@danirabbit
Copy link
Member

danirabbit commented Dec 13, 2024

Problem

Frequently requested in Discord lately is how to work with Gtk.ListBox

Proposal

We should have a section that shows:

  • How to create a Gtk.ListBox bound to a ListModel with a CreateWidgetFunc
  • Granite style classes for lists like RICH_LIST and BOXED_LIST
  • How to sort and filter a list model
  • How to use placeholders
  • How to use header functions

I would probably do it in this order:

  1. Create a list of items and style it with rich_list and boxed_list
  2. Change the model to use a sort func
  3. Add a header func
  4. Add a search entry and connect it to a filter func. Maybe also use https://valadoc.org/gtk4/Gtk.SearchEntry.set_key_capture_widget.html while we’re here
  5. Add a placeholder for when there’s no search results

Prior Art (Optional)

No response

@danirabbit danirabbit added the documentation Improvements or additions to documentation label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant