GtkTable v1.2.8 Mis-feature and Patch



The attached patch allows you to set the spacing for the last row and
column in a GtkTable. Although the spacing of the last row/column is
never used, when you grow the table the previous last row/column is no
longer last and their spacings become valid. The current behaviour means
you have to go back and set the spacings of the old last row/column when
the table grows. The problem only applies to the row/column that were
last at the time gtk_table_set_row/col_spacings() was called.

Phil
--- gtktable.c.orig	Wed Jul 26 12:58:52 2000
+++ gtktable.c	Wed Jul 26 13:49:30 2000
@@ -571,7 +571,7 @@
 {
   g_return_if_fail (table != NULL);
   g_return_if_fail (GTK_IS_TABLE (table));
-  g_return_if_fail (row + 1 < table->nrows);
+  g_return_if_fail (row < table->nrows);
   
   if (table->rows[row].spacing != spacing)
     {
@@ -589,7 +589,7 @@
 {
   g_return_if_fail (table != NULL);
   g_return_if_fail (GTK_IS_TABLE (table));
-  g_return_if_fail (column + 1 < table->ncols);
+  g_return_if_fail (column < table->ncols);
   
   if (table->cols[column].spacing != spacing)
     {
@@ -610,7 +610,7 @@
   g_return_if_fail (GTK_IS_TABLE (table));
   
   table->row_spacing = spacing;
-  for (row = 0; row + 1 < table->nrows; row++)
+  for (row = 0; row < table->nrows; row++)
     table->rows[row].spacing = spacing;
   
   if (GTK_WIDGET_VISIBLE (table))
@@ -627,7 +627,7 @@
   g_return_if_fail (GTK_IS_TABLE (table));
   
   table->column_spacing = spacing;
-  for (col = 0; col + 1 < table->ncols; col++)
+  for (col = 0; col < table->ncols; col++)
     table->cols[col].spacing = spacing;
   
   if (GTK_WIDGET_VISIBLE (table))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]