package Implements_Drag_Source is new Glib.Types.Implements (Gtk.Tree_Dnd.Gtk_Tree_Drag_Source, Gtk_Tree_Model_Filter_Record, Gtk_Tree_Model_Filter);
type Gtk_Tree_Model_Filter_Record is new Gtk.Tree_Model.Gtk_Tree_Model_Record with null record;
type Gtk_Tree_Model_Filter is access all Gtk_Tree_Model_Filter_Record'Class;
type Gtk_Tree_Model_Filter_Visible_Func is access function (Model : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; Iter : Gtk.Tree_Model.Gtk_Tree_Iter) return Boolean;
type Gtk_Tree_Model_Filter_Modify_Func is access procedure (Model : access Gtk_Tree_Model_Filter_Record'Class; Iter : Gtk.Tree_Model.Gtk_Tree_Iter; Value : out Glib.Values.GValue; Column : Gint);
procedure Gtk_New
( | Model | : out Gtk_Tree_Model_Filter; |
Child_Model | : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; | |
Root | : Gtk.Tree_Model.Gtk_Tree_Path := null); |
procedure Initialize
( | Model | : access Gtk_Tree_Model_Filter_Record'Class; |
Child_Model | : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; | |
Root | : Gtk.Tree_Model.Gtk_Tree_Path := null); |
function Get_Type return Glib.GType;
function Get_Model
( | Filter | : access Gtk_Tree_Model_Filter_Record) return Gtk.Tree_Model.Gtk_Tree_Model; |
procedure Convert_Child_Iter_To_Iter
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Filter_Iter | : out Gtk.Tree_Model.Gtk_Tree_Iter; | |
Child_Iter | : Gtk.Tree_Model.Gtk_Tree_Iter); |
function Convert_Child_Path_To_Path
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Child_Path | : Gtk.Tree_Model.Gtk_Tree_Path) return Gtk.Tree_Model.Gtk_Tree_Path; |
procedure Convert_Iter_To_Child_Iter
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Child_Iter | : out Gtk.Tree_Model.Gtk_Tree_Iter; | |
Filter_Iter | : Gtk.Tree_Model.Gtk_Tree_Iter); |
function Convert_Path_To_Child_Path
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Filter_Path | : Gtk.Tree_Model.Gtk_Tree_Path) return Gtk.Tree_Model.Gtk_Tree_Path; |
procedure Set_Visible_Column
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Column | : Gint); |
procedure Set_Visible_Func
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Func | : Gtk_Tree_Model_Filter_Visible_Func); |
procedure Refilter
( | Filter | : access Gtk_Tree_Model_Filter_Record); |
procedure Set_Modify_Func
( | Filter | : access Gtk_Tree_Model_Filter_Record; |
Types | : Glib.GType_Array; | |
Func | : Gtk_Tree_Model_Filter_Modify_Func); |
procedure Clear_Cache
( | Filter | : access Gtk_Tree_Model_Filter_Record); |
function "+"
( | Model | : access Gtk_Tree_Model_Filter_Record'Class) return Gtk.Tree_Dnd.Gtk_Tree_Drag_Source renames Implements_Drag_Source.To_Interface; |
function "-"
( | Drag_Source | : Gtk.Tree_Dnd.Gtk_Tree_Drag_Source) return Gtk_Tree_Model_Filter renames Implements_Drag_Source.To_Object; |
A Gtk_Tree_Model_Filter is a tree model which wraps another tree model, and can do the following things:
- Filter specific rows, based on data from a "visible column", a column storing booleans indicating whether the row should be filtered or not, or based on the return value of a "visible function", which gets a model, iter and user_data and returns a boolean indicating whether the row should be filtered or not.
- Modify the "appearance" of the model, using a modify function. This is extremely powerful and allows for just changing some values and also for creating a completely different model based on the given child model.
- Set a different root node, also known as a "virtual root". You can pass in a Gtk_Tree_Path indicating the root node for the filter at construction time.
Binding from C File version 2.8.17
<testgtk>create_tree_filter.adb</testgtk>