Set the minimum-extent property from the size_allocate handler of the sheet
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 25 Nov 2008 01:51:38 +0000 (10:51 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 25 Nov 2008 01:51:38 +0000 (10:51 +0900)
lib/gtksheet/gtksheet.c
lib/gtksheet/psppire-axis.c

index 8b25902c3b1cc2421c2e5e101b9dbeb77bc7aff8..d8517ae30a4eb70745b68683c5553c64eb30fa8e 100644 (file)
@@ -4432,6 +4432,23 @@ gtk_sheet_size_allocate (GtkWidget *widget,
                            sheet->row_title_area.height);
 
 
+
+
+
+
+  if (sheet->haxis)
+    {
+      gint width = sheet->column_title_area.width;
+
+      if ( sheet->row_titles_visible)
+       width -= sheet->row_title_area.width;
+
+      g_object_set (sheet->haxis,
+                   "minimum-extent", width,
+                   NULL);
+    }
+
+
   /* set the scrollbars adjustments */
   adjust_scrollbars (sheet);
 }
index 7b154908b6748aab76fbbb12da88d913621ad6f5..a46bb48386ddc83e9ad3a8c6da48b20fdd3a47c8 100644 (file)
@@ -129,10 +129,12 @@ psppire_axis_class_init (PsppireAxisClass *class)
   object_class->get_property = psppire_axis_get_property;
 
   min_extent_spec =
-    g_param_spec_pointer ("minimum-extent",
-                         "Minimum Extent",
-                         "The smallest extent to which the axis will provide units (typically set to the height/width of the associated widget)",
-                         G_PARAM_WRITABLE | G_PARAM_READABLE );
+    g_param_spec_long ("minimum-extent",
+                      "Minimum Extent",
+                      "The smallest extent to which the axis will provide units (typically set to the height/width of the associated widget)",
+                      0, G_MAXLONG,
+                      800,
+                      G_PARAM_WRITABLE | G_PARAM_READABLE );
 
   g_object_class_install_property (object_class,
                                    PROP_MIN_EXTENT,