Index

Package: Set_Visible_Func_User_Data (generic)

Description

generic
      type User_Data_Type (<>) is private;
      with procedure Destroy (Data : in out User_Data_Type) is null;
   package Set_Visible_Func_User_Data is

Types

User_Data_Type

type User_Data_Type (<>) is private;

Gtk_Tree_Model_Filter_Visible_Func

type Gtk_Tree_Model_Filter_Visible_Func is access function
        (Model : Gtk.Tree_Model.Gtk_Tree_Model;
         Iter  : Gtk.Tree_Model.Gtk_Tree_Iter;
         Data  : User_Data_Type) return Boolean;
A function which decides whether the row indicated by Iter is visible. "model": the child model of the Gtk.Tree_Model_Filter.Gtk_Tree_Model_Filter "iter": a Gtk.Tree_Model.Gtk_Tree_Iter pointing to the row in Model whose visibility is determined "data": user data given to Gtk.Tree_Model_Filter.Set_Visible_Func

Subprograms & Entries

Destroy

procedure Destroy 
(Data: in out User_Data_Type) is null;

Set_Visible_Func

procedure Set_Visible_Func 
(Self: not null access Gtk.Tree_Model_Filter.Gtk_Tree_Model_Filter_Record'Class;
Func: Gtk_Tree_Model_Filter_Visible_Func;
Data: User_Data_Type);
Sets the visible function used when filtering the Filter to be Func. The function should return True if the given row should be visible and False otherwise. If the condition calculated by the function changes over time (e.g. because it depends on some global parameters), you must call Gtk.Tree_Model_Filter.Refilter to keep the visibility information of the model uptodate. Note that Func is called whenever a row is inserted, when it may still be empty. The visible function should therefore take special care of empty rows, like in the example below. static gboolean visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { /* Visible if row is non-empty and first column is "HI" */ gchar *str; gboolean visible = FALSE; gtk_tree_model_get (model, iter, 0, &str, -1); if (str && strcmp (str, "HI") == 0) visible = TRUE; g_free (str); return visible; } Since: gtk+ 2.4 "func": A Gtk_Tree_Model_Filter_Visible_Func, the visible function. "data": User data to pass to the visible function, or null.