Skip to content

SignatureDialog: Use ListStore - #1081

Open
danirabbit wants to merge 2 commits into
masterfrom
danirabbit/signaturedialog-liststore
Open

SignatureDialog: Use ListStore#1081
danirabbit wants to merge 2 commits into
masterfrom
danirabbit/signaturedialog-liststore

Conversation

@danirabbit

Copy link
Copy Markdown
Member

can't use get_children in GTK4. We can technically iterate over the listbox still, but it's better to iterate over data

@danirabbit
danirabbit requested a review from a team August 6, 2026 20:03
@danirabbit danirabbit moved this to Needs Review in GTK4 Porting Aug 6, 2026

@jeremypw jeremypw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the filter function will have to be reimplemented a different way, otherwise looking good.

signature_list.set_filter_func ((Gtk.ListBoxFilterFunc)filter_func);
signature_list.set_placeholder (placeholder);
signature_list_box.bind_model (signature_list, (obj) => (Signature) obj);
signature_list_box.set_filter_func ((Gtk.ListBoxFilterFunc)filter_func);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this ignored when bound to a model? I get the terminal message GtkListBox with a model will ignore sort and filter functions

@danirabbit

Copy link
Copy Markdown
Member Author

@jeremypw in GTK4 we can use a filter list model. Does this not work for you?

@jeremypw

jeremypw commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@jeremypw in GTK4 we can use a filter list model. Does this not work for you?

In Gtk4 you still cannot use the set_filter_func function of the ListBox but yes, you could wrap the model in a Gtk.FilterListModel. I haven't looked deeply into it but the code looks weird anyway - the filter is dependent on the presence/absence of a timout. I would have thought there is a better way of doing it. Can't we just remove the item from the model when it starts to get deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants