Hi,
As I was playina with the new concepts of Lists in Gtk4, I have conceptualized how this works, but please correct me if something is wrong:
- You populate a GLib.ListModel (or GLib.ListStore) with your data.
- one can change the selection method by passing this model to Gtk.SelectionModel.
- Sorting can be done by creating a Gtk.Sorter and passing the model with the sorter to a Gtk.ListSortMode.
- you create a factory responsible for populating ListItem and how should they be displayed.
- you create one of the widgets capable of displaying lists passing the model and the factory to it, model here means the sorted/selected model.
My question is, why the following list always ignore the Selection method, irrelevant which one I choose, NoSelection, SingleSelection or MultiSelection.
var color_model = new Gtk4Demo.ColorListModel (4096);
var factory = new Gtk.SignalListItemFactory ();
// The following always displayes single selection no matter which selection method I choose?
var selection = new Gtk.NoSelection (color_model);
var numeric_sorter = new Gtk.NumericSorter (new Gtk.PropertyExpression (typeof (Gtk4Demo.ColorWidget), null, "red"));
numeric_sorter.set_sort_order (Gtk.SortType.DESCENDING);
var sorters = new Gtk.SortListModel(selection, numeric_sorter);
factory.setup.connect (setup_colorlist_cb);
gridview.model = sorters;
gridview.factory = factory;
Is there anything untrue regarding my ideas?
Thanks