gtk-sharp[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4]Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.GLib.ObjectGtk.ITreeDragSourceGtk.ITreeModelAn object designed to filter the contents of a column or columns
in a for display.
using System;
using Gtk;
public class MyWindow : Window
{
TreeView view;
TreeModelFilter filter;
Entry search;
static void Main ()
{
Application.Init ();
new MyWindow ();
Application.Run ();
}
public MyWindow () : base ("MyWindow")
{
this.SetDefaultSize (400, 300);
this.DeleteEvent += new DeleteEventHandler (OnMyWindowDelete);
view = new TreeView ();
view.AppendColumn ("test", new CellRendererText (), "text", 0);
TreeStore store = new TreeStore (typeof (string));
string[] names = new string[] {"bob", "joe", "joseph", "frank"};
foreach (string name in names)
store.AppendValues (name);
view.Model = store;
filter = new TreeModelFilter (store, null);
filter.VisibleFunc = SearchFilterFunc;
VBox vbox = new VBox (false, 6);
search = new Entry ();
search.Activated += OnSearch;
Label l = new Label ("Search:");
l.Xalign = 0.0f;
vbox.PackStart (l, false, true, 0);
vbox.PackStart (search, false, true, 0);
vbox.PackStart (view, true, true, 0);
this.Add (vbox);
this.ShowAll ();
}
bool SearchFilterFunc (TreeModel model, TreeIter iter)
{
// no search term, show all
if (search.Text.Trim ().Length < 1)
return true;
string t = (string) model.GetValue (iter, 0);
return t.StartsWith (search.Text.Trim ());
}
void OnSearch (object sender, EventArgs a)
{
view.Model = filter;
filter.Refilter ();
}
void OnMyWindowDelete (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
}
Constructor
a , pointer to the underlying C object.
Constructor. For internal use.Constructor
To be added.
To be added.
To be added.To be added.PropertyGLib.Property("child-model")Gtk.ITreeModelChild tree data model.a MethodSystem.VoidThis function should almost never be called.This function clears the filter of any cached iterators that haven't been reffed with
. This might be useful if the child model
being filtered is static (and doesn't change often) and there has been
a lot of unreffed access to nodes. As a side effect of this function,
all unreffed iterators will be invalid.Added in GTK 2.4.MethodGtk.TreeIter
a Sets the filter's iterator to point to the row that corresponds to .a MethodGtk.TreePath
a Converts to a path relative to this filter.a or . points to a path in the child model. The returned path will point to the
same row in the filtered model. If isn't a valid path on the
child model, then is returned.
MethodGtk.TreeIter
a Returns a new iterator that points to the row pointed to
by .a MethodGtk.TreePath
a Converts to a path on the child model of this filter.a points to a location in this
filter. The returned path will point to the same location in the
model not being filtered. If
does not point to a location in the child model,
is returned.
MethodSystem.Boolean
a , the path of the row that was dragged
This method asks the source row for the dragged data to delete itself, because that data has been moved elsewhere.a This method returns FALSE if the deletion fails because path no longer exists, or for some other model-specific reason.MethodSystem.Boolean
a
a object to fill with data
Asks the to fill in with a representation of the row at . Should robustly handle a path no longer found in the model.A see cref="T:System.Boolean" />; true if data of the required type was provided.MethodSystem.Void
a , points to the changed row
a , points to the changed row
Emits an event
for .MethodSystem.Void
a Emits an event
for .MethodSystem.Void
a , points to the changed row
a , points to the changed row
Emits an event
for .This should be called by models after the child state of
a node changes.MethodSystem.Void
a
a , points to the inserted row.
Emits an event
for .MethodSystem.Void
To be added.
To be added.
To be added.
To be added.To be added.PropertyGtk.TreeModelFlagsFlag values for this tree model; see for possible values.a MethodSystem.Void
a Calls a function on each row of a tree.MethodGLib.GType
a Gets the data type stored in the column at .a MethodSystem.Boolean
an object of type
an object of type Sets to a valid iterator pointing to .an object of type MethodSystem.Boolean
an object of type Gets the first iterator in the tree (the one at the path "0") and returns .an object of type Returns if the tree is empty.MethodSystem.Boolean
an object of type
an object of type Gets the at .an object of type Otherwise, is left invalid and is returned.MethodGtk.TreePath
an object of type Gets the of .an object of type MethodSystem.String
a Generates a string representation of the path of .a This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.MethodSystem.Void
a
a , pointer to the va_list data structure of arguments (FIXME: clarify what va_lists look like)
Gets the values of child properties for the row pointed to by MethodSystem.Object
a
a Sets the value of column in the row pointed to by to if the value is a .a MethodSystem.Void
a
a
To be added.
Gets the value stored in column of the row pointed to by .PropertyGLib.GTypeThe of this object.a MethodSystem.Boolean
an object of type Sets the TreeIter object pointed to by to point to the first child of this tree. an object of type , true if the iter has been set to the first child.MethodSystem.Boolean
an object of type
To be added.
Sets the TreeIter object pointed to by to point to the first child of this tree. an object of type , true if the iter has been set to the first child.MethodSystem.Boolean
an object of type Returns if has children, otherwise.an object of type MethodSystem.Int32Returns the number of children that has.an object of type As a special case, if is , then the number of toplevel nodes is returned.MethodSystem.Int32
an object of type Returns the number of children that has.an object of type As a special case, if is , then the number of toplevel nodes is returned.MethodSystem.Boolean
a Gets the next row to be filtered.a MethodSystem.Boolean
an object of type
an object of type Sets to be the child of the root node, using the given index.an object of type In this case, the nth root node is set.MethodSystem.Boolean
an object of type
To be added.
an object of type Sets to be the child of the root node, using the given index.an object of type In this case, the nth root node is set.MethodSystem.Boolean
an object of type
an object of type Sets to be the parent of .an object of type If is at the toplevel, and does not have a parent, then is set to an invalid iterator and is returned. will remain a valid node after this function has been called.MethodSystem.Boolean
To be added.
To be added.To be added.To be added.PropertyGtk.ITreeModelGets the this filter is being applied to.a PropertySystem.Int32The number of columns in the model.a MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideModify", Type=typeof(Gtk.TreeModelFilter))System.Void
To be added.
To be added.
To be added.
To be added.
To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowChanged", Type=typeof(Gtk.TreeModelFilter))System.Void
a
a Emits the "row_changed" signal for this model.This should be called by models when their rows have been reordered.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowDeleted", Type=typeof(Gtk.TreeModelFilter))System.Void
a Emits the signal for this model.This should be called by models when their rows have been reordered.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowHasChildToggled", Type=typeof(Gtk.TreeModelFilter))System.Void
a
a Emits the signal for this model.This should be called by models when a row's child has been toggled on or off.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowInserted", Type=typeof(Gtk.TreeModelFilter))System.Void
a
a Emits the signal for this model.This should be called by models when a row has been inserted.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowsReordered", Type=typeof(Gtk.TreeModelFilter))System.Obsolete("Replaced by int[] new_order overload.")System.Void
a pointing to the tree node whose children have been reordered
a pointing to the tree node whose children have been reordered
a , an array of integers containing the new indices of the children, i.e. the former child n is now at position new_order[n].
Emits the "rows_reordered" signal for this tree model.
This should be called by models when their rows have been reordered.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideRowsReordered", Type=typeof(Gtk.TreeModelFilter))System.Void
Path to the reordered parent node.
Iter corresponding to the reordered parent node.
An array of the old indices.
Default handler for the RowsReordered event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideVisible", Type=typeof(Gtk.TreeModelFilter))System.Boolean
To be added.
To be added.
To be added.To be added.To be added.MethodSystem.VoidEmits for each row in the child model, which causes the filter to re-evaluate whether a row is visible or not.Added in GTK 2.4.MethodSystem.Void
an object of type Lets the tree ref the node.This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons.This function is primarily meant as a way for views to let caching models know when nodes are being displayed (and hence, whether or not to cache that node.) For example, a file-system based model would not want to keep the entire file-hierarchy in memory, just the sections that are currently being displayed by every current view.A model should be expected to be able to get an iter independent of its referenced state.EventGLib.Signal("row-changed")Gtk.RowChangedHandlerEvent that happens when a row in the model is changed.EventGLib.Signal("row-deleted")Gtk.RowDeletedHandlerEvent that happens when a row is deleted.MethodSystem.Boolean
a , the row being checked
Checks to see whether a given row can be used as a source for a drag-and-drop operation.a , TRUE if the row is draggable.If the object does not implement this method, the row is assumed to be draggable.EventGLib.Signal("row-has-child-toggled")Gtk.RowHasChildToggledHandlerEvent that happens when a row's child visibility is turned on or off.EventGLib.Signal("row-inserted")Gtk.RowInsertedHandlerEvent that happens when a row is inserted.EventGLib.Signal("rows_reordered")Gtk.RowsReorderedHandlerEvent that happens when rows in the model change order.MethodSystem.Void
a
an array of
a Sets a function to modify the display of the model.
With the and parameters, you give an array of column
types for this model (which will be exposed to the parent model/view).
The modify function, , will get called for each
data access; the goal of the modify function is to return the data which
should be displayed at the location specified using the parameters of the
modify function.
MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a boolean.MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a
a
a Sets the value of column in the row pointed to by to if the value is a .MethodSystem.Void
a Decrements the reference count for the node at .PropertyGLib.Property("virtual-root")Gtk.TreePathThe virtual root (relative to the child model) for this object.a PropertySystem.Int32The column of the model where this filter should look for visibility information.a PropertyGtk.TreeModelFilterVisibleFuncThe function used to determine whether or not a row should be visiblea