]> Pileus Git - ~andy/gtk/commitdiff
Use accessor functions to access GtkTable
authorJavier Jardón <jjardon@gnome.org>
Tue, 13 Jul 2010 02:09:38 +0000 (04:09 +0200)
committerJavier Jardón <jjardon@gnome.org>
Tue, 13 Jul 2010 17:40:50 +0000 (19:40 +0200)
gtk/gtkprintunixdialog.c

index c6d6d0fe07ccac4dd3ea3a41a57419d5042b9a59..6c6c8044ee7f6c76976900179f29563b98fb7197 100644 (file)
@@ -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
         {