File: unsorted_list.mli

package info (click to toggle)
0install-solver 2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,324 kB
  • sloc: ml: 26,363; xml: 2,700; sh: 198; ansic: 132; python: 105; makefile: 68
file content (30 lines) | stat: -rw-r--r-- 1,214 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(* Copyright (C) 2013, Thomas Leonard
 * See the README file for details, or visit http://0install.net.
 *)

(** A GTK list store with its own types *)

(* When displaying items in a TreeView/IconView, we often have two models: an
 * underlying model and a sorted view of it, which is what the widget displays.
 * It's very important not to confuse the iterators of one model with those of
 * the other, or you may act on the wrong data.
 *
 * For example, to delete a row you need to call the delete operation on the underlying model,
 * using an underlying iterator. But the TreeView's get_selected_rows returns iterators in the
 * sorted model.
 *
 * This module isolates the underlying model and its iterators from the rest of the code, so
 * mixups aren't possible.
 *)
type t
type iter
val list_store : GTree.column_list -> t
val clear : t -> unit
val model_sort : t -> GTree.model_sort
val get_iter_first : t -> iter option
val set : t -> row:iter -> column:'a GTree.column -> 'a -> unit
val get : t -> row:iter -> column:'a GTree.column -> 'a
val remove : t -> iter -> bool
val convert_iter_to_child_iter : GTree.model_sort -> Gtk.tree_iter -> iter
val append : t -> iter
val iter_next : t -> iter -> bool