diff options
author | Lars Hamann <lars@gtk.org> | 1998-11-18 23:55:10 +0000 |
---|---|---|
committer | Lars Hamann <lars@src.gnome.org> | 1998-11-18 23:55:10 +0000 |
commit | 735132708950a2f9b39410bceb43434ba06d9be1 (patch) | |
tree | d08c29afa17d41a4c7a950a2754cd4ac4e2ede16 /gtk | |
parent | 3725bc3ad9f8a4669674b51b351c72be8a1b1d89 (diff) | |
download | gtk+-735132708950a2f9b39410bceb43434ba06d9be1.tar.gz |
return the nth GtkCTreeNode in row_list. (from Samuel Solon
Thu Nov 19 00:15:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_node_nth): return the nth GtkCTreeNode
in row_list. (from Samuel Solon <ssolon@usa.net>)
* gtk/gtkclist.c (gtk_clist_get_column_title): return column title
(gtk_clist_get_column_widget): return column widget
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkclist.c | 30 | ||||
-rw-r--r-- | gtk/gtkclist.h | 8 | ||||
-rw-r--r-- | gtk/gtkctree.c | 13 | ||||
-rw-r--r-- | gtk/gtkctree.h | 2 |
4 files changed, 53 insertions, 0 deletions
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); |