GtkLayout, segfaulting with [hv]adjustment properties



i am getting a segfault in GtkLayout if i set the height/width
properties before [hv]adjustment properties.

in looking at it, i think it makes sense in gtk_layout_init() to call
gtk_layout_set_adjustments(layout, NULL, NULL) rather than setting both
of the adjustments to NULL.

this is because typically, you are calling gtk_layout_new(), which does
call gtk_layout_set_adjustments().

i've attached some sample code wich seg faults with current cvs, but
doesn't with the attached patch.

thoughts?

jacob
-- 
"Beat mixing is 10000 times more fun than even video games."
	-- bt
Index: gtklayout.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklayout.c,v
retrieving revision 1.44
diff -u -r1.44 gtklayout.c
--- gtklayout.c	2001/09/08 19:33:05	1.44
+++ gtklayout.c	2001/11/14 18:12:37
@@ -774,6 +774,8 @@
   layout->visibility = GDK_VISIBILITY_PARTIAL;
 
   layout->freeze_count = 0;
+
+  gtk_layout_set_adjustments (layout, NULL, NULL);
 }
 
 /* Widget methods
#include <gtk/gtk.h>

int
main (int argc, char *argv[])
{
  GtkAdjustment *h, *v;
  GtkWidget *layout;

  gtk_init (&argc, &argv);

  h = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  v = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);

  g_object_new (GTK_TYPE_LAYOUT, 
		"height", 100,
		"width", 100,
		"hadjustment", h,
		"vadjustment", v,
		NULL);
}


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