From 735132708950a2f9b39410bceb43434ba06d9be1 Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Wed, 18 Nov 1998 23:55:10 +0000 Subject: [PATCH] return the nth GtkCTreeNode in row_list. (from Samuel Solon Thu Nov 19 00:15:27 1998 Lars Hamann * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode in row_list. (from Samuel Solon ) * gtk/gtkclist.c (gtk_clist_get_column_title): return column title (gtk_clist_get_column_widget): return column widget --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkclist.c | 30 ++++++++++++++++++++++++++++++ gtk/gtkclist.h | 8 ++++++++ gtk/gtkctree.c | 13 +++++++++++++ gtk/gtkctree.h | 2 ++ 11 files changed, 109 insertions(+) diff --git a/ChangeLog b/ChangeLog index 22818b6516..92a801b9be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 22818b6516..92a801b9be 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Thu Nov 19 00:15:27 1998 Lars Hamann + + * gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode + in row_list. (from Samuel Solon ) + + * gtk/gtkclist.c (gtk_clist_get_column_title): return column title + (gtk_clist_get_column_widget): return column widget + Wed Nov 18 11:54:57 1998 Owen Taylor * gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index e39135cddb..79ed963d0e 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -1177,6 +1177,7 @@ gtk_clist_thaw (GtkCList *clist) * gtk_clist_column_titles_active * gtk_clist_column_titles_passive * gtk_clist_set_column_title + * gtk_clist_get_column_title * gtk_clist_set_column_widget * gtk_clist_set_column_justification * gtk_clist_set_column_visibility @@ -1346,6 +1347,19 @@ gtk_clist_set_column_title (GtkCList *clist, size_allocate_title_buttons (clist); } +gchar * +gtk_clist_get_column_title (GtkCList *clist, + gint column) +{ + g_return_val_if_fail (clist != NULL, NULL); + g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); + + if (column < 0 || column >= clist->columns) + return NULL; + + return clist->column[column].title; +} + void gtk_clist_set_column_widget (GtkCList *clist, gint column, @@ -1389,6 +1403,22 @@ gtk_clist_set_column_widget (GtkCList *clist, size_allocate_title_buttons (clist); } +GtkWidget * +gtk_clist_get_column_widget (GtkCList *clist, + gint column) +{ + g_return_val_if_fail (clist != NULL, NULL); + g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); + + if (column < 0 || column >= clist->columns) + return NULL; + + if (clist->column[column].button) + return GTK_BUTTON (clist->column[column].button)->child; + + return NULL; +} + void gtk_clist_set_column_justification (GtkCList *clist, gint column, diff --git a/gtk/gtkclist.h b/gtk/gtkclist.h index 37a6d81eb5..c9948abd29 100644 --- a/gtk/gtkclist.h +++ b/gtk/gtkclist.h @@ -429,11 +429,19 @@ void gtk_clist_set_column_title (GtkCList *clist, gint column, const gchar *title); +/* returns the title of column. Returns NULL if title is not set */ +gchar * gtk_clist_get_column_title (GtkCList *clist, + gint column); + /* set a widget instead of a title for the column title button */ void gtk_clist_set_column_widget (GtkCList *clist, gint column, GtkWidget *widget); +/* returns the column widget */ +GtkWidget * gtk_clist_get_column_widget (GtkCList *clist, + gint column); + /* set the justification on a column */ void gtk_clist_set_column_justification (GtkCList *clist, gint column, diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index e3283b0906..140c8a4f23 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -4294,6 +4294,19 @@ gtk_ctree_find_node_ptr (GtkCTree *ctree, return node; } +GtkCTreeNode * +gtk_ctree_node_nth (GtkCTree *ctree, + guint row) +{ + g_return_val_if_fail (ctree != NULL, NULL); + g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); + + if ((row < 0) || (row >= GTK_CLIST(ctree)->rows)) + return NULL; + + return GTK_CTREE_NODE (g_list_nth (GTK_CLIST (ctree)->row_list, row)); +} + gboolean gtk_ctree_find (GtkCTree *ctree, GtkCTreeNode *node, diff --git a/gtk/gtkctree.h b/gtk/gtkctree.h index 784b3400a1..2d7dddaa5b 100644 --- a/gtk/gtkctree.h +++ b/gtk/gtkctree.h @@ -238,6 +238,8 @@ GtkCTreeNode * gtk_ctree_last (GtkCTree *ctree, GtkCTreeNode *node); GtkCTreeNode * gtk_ctree_find_node_ptr (GtkCTree *ctree, GtkCTreeRow *ctree_row); +GtkCTreeNode * gtk_ctree_node_nth (GtkCTree *ctree, + guint row); gboolean gtk_ctree_find (GtkCTree *ctree, GtkCTreeNode *node, GtkCTreeNode *child);