[gtk+] [GtkTable] Add gtk_table_get_size()
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] [GtkTable] Add gtk_table_get_size()
- Date: Thu, 24 Jun 2010 15:46:32 +0000 (UTC)
commit 71e69e4701fd2975b9bb59ecc0b36193c4fc5b9f
Author: Javier Jardón <jjardon gnome org>
Date: Thu Jun 24 17:28:18 2010 +0200
[GtkTable] Add gtk_table_get_size()
Add accessor function to retrieve the number of rows and columns
in the table.
docs/reference/gtk/gtk3-sections.txt | 1 +
gtk/gtk.symbols | 1 +
gtk/gtktable.c | 26 ++++++++++++++++++++++++++
gtk/gtktable.h | 3 +++
4 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 8bc5fe4..21dc9d1 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -3081,6 +3081,7 @@ gtk_status_icon_get_type
GtkTable
gtk_table_new
gtk_table_resize
+gtk_table_get_size
gtk_table_attach
gtk_table_attach_defaults
gtk_table_set_row_spacing
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 84c10a1..e216468 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -3278,6 +3278,7 @@ gtk_table_get_default_col_spacing
gtk_table_get_default_row_spacing
gtk_table_get_homogeneous
gtk_table_get_row_spacing
+gtk_table_get_size
gtk_table_get_type G_GNUC_CONST
gtk_table_new
gtk_table_resize
diff --git a/gtk/gtktable.c b/gtk/gtktable.c
index dd14bed..79efc26 100644
--- a/gtk/gtktable.c
+++ b/gtk/gtktable.c
@@ -796,6 +796,32 @@ gtk_table_get_homogeneous (GtkTable *table)
return table->homogeneous;
}
+/**
+ * gtk_table_get_size:
+ * @table: a #GtkTable
+ * @rows: (allow-none): (out): return location for the number of
+ * rows, or %NULL
+ * @columns: (allow-none): (out): return location for the number
+ * of columns, or %NULL
+ *
+ * Returns the number of rows and columns in the table.
+ *
+ * Since: 2.22
+ **/
+void
+gtk_table_get_size (GtkTable *table,
+ guint *rows,
+ guint *columns)
+{
+ g_return_if_fail (GTK_IS_TABLE (table));
+
+ if (rows)
+ *rows = table->nrows;
+
+ if (columns)
+ *columns = table->ncols;
+}
+
static void
gtk_table_finalize (GObject *object)
{
diff --git a/gtk/gtktable.h b/gtk/gtktable.h
index f993d7e..f89958b 100644
--- a/gtk/gtktable.h
+++ b/gtk/gtktable.h
@@ -141,6 +141,9 @@ guint gtk_table_get_default_col_spacing (GtkTable *table);
void gtk_table_set_homogeneous (GtkTable *table,
gboolean homogeneous);
gboolean gtk_table_get_homogeneous (GtkTable *table);
+void gtk_table_get_size (GtkTable *table,
+ guint *rows,
+ guint *columns);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]