[GtkTable] Add gtk_table_get_size()

Add accessor function to retrieve the number of rows and columns
in the table.
This commit is contained in:
Javier Jardón 2010-06-24 17:28:18 +02:00
parent 9bf7f99a17
commit 71e69e4701
4 changed files with 31 additions and 0 deletions

View File

@ -3081,6 +3081,7 @@ gtk_status_icon_get_type
GtkTable GtkTable
gtk_table_new gtk_table_new
gtk_table_resize gtk_table_resize
gtk_table_get_size
gtk_table_attach gtk_table_attach
gtk_table_attach_defaults gtk_table_attach_defaults
gtk_table_set_row_spacing gtk_table_set_row_spacing

View File

@ -3278,6 +3278,7 @@ gtk_table_get_default_col_spacing
gtk_table_get_default_row_spacing gtk_table_get_default_row_spacing
gtk_table_get_homogeneous gtk_table_get_homogeneous
gtk_table_get_row_spacing gtk_table_get_row_spacing
gtk_table_get_size
gtk_table_get_type G_GNUC_CONST gtk_table_get_type G_GNUC_CONST
gtk_table_new gtk_table_new
gtk_table_resize gtk_table_resize

View File

@ -796,6 +796,32 @@ gtk_table_get_homogeneous (GtkTable *table)
return table->homogeneous; 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 static void
gtk_table_finalize (GObject *object) gtk_table_finalize (GObject *object)
{ {

View File

@ -141,6 +141,9 @@ guint gtk_table_get_default_col_spacing (GtkTable *table);
void gtk_table_set_homogeneous (GtkTable *table, void gtk_table_set_homogeneous (GtkTable *table,
gboolean homogeneous); gboolean homogeneous);
gboolean gtk_table_get_homogeneous (GtkTable *table); gboolean gtk_table_get_homogeneous (GtkTable *table);
void gtk_table_get_size (GtkTable *table,
guint *rows,
guint *columns);
G_END_DECLS G_END_DECLS