Created
January 19, 2016 17:25
-
-
Save bratsche/87860b5e2f69450123dd to your computer and use it in GitHub Desktop.
SetSortFunc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SetSortFunc(int sort_column_id, Gtk.TreeIterCompareFunc sort_func) { | |
GtkSharp.TreeIterCompareFuncWrapper sort_func_wrapper = new GtkSharp.TreeIterCompareFuncWrapper (sort_func); | |
IntPtr user_data; | |
GLib.DestroyNotify destroy; | |
if (sort_func == null) { | |
user_data = IntPtr.Zero; | |
destroy = null; | |
} else { | |
user_data = (IntPtr) GCHandle.Alloc (sort_func_wrapper); | |
destroy = GLib.DestroyHelper.NotifyHandler; | |
} | |
gtk_tree_sortable_set_sort_func(Handle, sort_column_id, sort_func_wrapper.NativeDelegate, user_data, destroy); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment