diff options
author | Stefan Jeske <stefan@gtk.org> | 1998-08-05 20:02:32 +0000 |
---|---|---|
committer | Stefan Jeske <stefan@src.gnome.org> | 1998-08-05 20:02:32 +0000 |
commit | c8df83a2fee148d871b36ca5ac742dc566c64612 (patch) | |
tree | 37dcd8897135303e9db3ca6e858f53c6b095455b /gtk/gtkctree.h | |
parent | e48d4e715947f7b976e14dcdb8bb431c60c485cc (diff) | |
download | gtk+-c8df83a2fee148d871b36ca5ac742dc566c64612.tar.gz |
new enum GtkSortType.
Wed Aug 5 21:12:37 1998 Stefan Jeske <stefan@gtk.org>
* gtk/gtkenums.h: new enum GtkSortType.
* gtk/gtkclist.h:
* gtk/gtkclist.c:
Added sorting capabilities to GtkCList. New APIs :
gtk_clist_set_compare_func, gtk_clist_set_sort_column,
gtk_clist_set_sort_type, gtk_clist_sort, gtk_clist_set_auto_sort.
New internal functions : default_compare, merge, mergesort.
(gtk_clist_append): This is just a wrapper for gtk_clist_insert now.
(gtk_clist_insert): Modified to handle gtk_clist_append and the
auto sort flag. Changed the return value from void to gint to
return the row number where the element was actually inserted.
(gtk_clist_swap_rows): Return immediately if auto sort flag is set.
* gtk/gtkctree.h:
* gtk/gtkctree.c:
Removed the auto_sort flag, replaced ctree->node_compare with
clist->compare all over the place, modified default_compare to
match clist's needs. Removed API´s : gtk_ctree_set_auto_sort,
gtk_ctree_set_compare_func. Removed GtkCTreeCompareFunc typedef.
* gtk/testgtk.c: Modified clist/ctree samples to demonstrate
sorting. The lists can be sorted by a column by clicking the
corresponding title button.
Diffstat (limited to 'gtk/gtkctree.h')
-rw-r--r-- | gtk/gtkctree.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/gtk/gtkctree.h b/gtk/gtkctree.h index 77f5fb7bd5..c9d9b5e1bd 100644 --- a/gtk/gtkctree.h +++ b/gtk/gtkctree.h @@ -81,17 +81,12 @@ typedef void (*GtkCTreeFunc) (GtkCTree *ctree, GtkCTreeNode *node, gpointer data); -typedef gint (*GtkCTreeCompareFunc) (GtkCTree *ctree, - const GtkCTreeNode *node1, - const GtkCTreeNode *node2); - typedef gboolean (*GtkCTreeGNodeFunc) (GtkCTree *ctree, guint depth, GNode *gnode, GtkCTreeNode *cnode, gpointer data); - struct _GtkCTree { GtkCList clist; @@ -108,9 +103,7 @@ struct _GtkCTree GtkCTreeNode *drag_source; GtkCTreeNode *drag_target; gint insert_pos; - GtkCTreeCompareFunc node_compare; - - guint auto_sort : 1; + guint reorderable : 1; guint use_icons : 1; guint in_drag : 1; @@ -384,10 +377,6 @@ void gtk_ctree_set_line_style (GtkCTree *ctree, * Tree sorting functions * ***********************************************************/ -void gtk_ctree_set_auto_sort (GtkCTree *ctree, - gboolean auto_sort); -void gtk_ctree_set_compare_func (GtkCTree *ctree, - GtkCTreeCompareFunc cmp_func); void gtk_ctree_sort (GtkCTree *ctree, GtkCTreeNode *node); void gtk_ctree_sort_recursive (GtkCTree *ctree, |