[gtk+/refactor: 105/106] Use accessor functions to access GtkTable
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 105/106] Use accessor functions to access GtkTable
- Date: Tue, 13 Jul 2010 17:38:50 +0000 (UTC)
commit 404e71b1e75fa197cbe71aedbb94ba6323a3515b
Author: Javier Jardón <jjardon gnome org>
Date: Tue Jul 13 04:09:38 2010 +0200
Use accessor functions to access GtkTable
gtk/gtkprintunixdialog.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index c6d6d0f..6c6c804 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -1201,7 +1201,7 @@ add_option_to_table (GtkPrinterOption *option,
{
GtkTable *table;
GtkWidget *label, *widget;
- gint row;
+ guint row;
table = GTK_TABLE (user_data);
@@ -1211,8 +1211,8 @@ add_option_to_table (GtkPrinterOption *option,
widget = gtk_printer_option_widget_new (option);
gtk_widget_show (widget);
- row = table->nrows;
- gtk_table_resize (table, table->nrows + 1, 2);
+ gtk_table_get_size (table, &row, NULL);
+ gtk_table_resize (table, row + 1, 2);
if (gtk_printer_option_widget_has_external_label (GTK_PRINTER_OPTION_WIDGET (widget)))
{
@@ -1239,10 +1239,14 @@ setup_page_table (GtkPrinterOptionSet *options,
GtkWidget *table,
GtkWidget *page)
{
+ guint nrows;
+
gtk_printer_option_set_foreach_in_group (options, group,
add_option_to_table,
table);
- if (GTK_TABLE (table)->nrows == 1)
+
+ gtk_table_get_size (GTK_TABLE (table), &nrows, NULL);
+ if (nrows == 1)
gtk_widget_hide (page);
else
gtk_widget_show (page);
@@ -1335,6 +1339,7 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
gchar *group;
GtkWidget *table, *frame;
gboolean has_advanced, has_job;
+ guint nrows;
if (priv->current_printer == NULL)
{
@@ -1413,7 +1418,9 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
group,
add_option_to_table,
table);
- if (GTK_TABLE (table)->nrows == 1)
+
+ gtk_table_get_size (GTK_TABLE (table), &nrows, NULL);
+ if (nrows == 1)
gtk_widget_destroy (table);
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]