diff gtk/dw.c @ 447:5a0779561d0f

Add more tests for dw_pac*() functions. Throw up a messagebox if you try and pack an item into itself; at least under GTK this causes an inifinite loop. Under GTK, add functionality to dw_spinbutton_set_limits() to actually do something.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 03 Jun 2003 09:13:35 +0000
parents 7c8bd3bc6c27
children 787cc1e27897
line wrap: on
line diff
--- a/gtk/dw.c	Tue Jun 03 09:08:33 2003 +0000
+++ b/gtk/dw.c	Tue Jun 03 09:13:35 2003 +0000
@@ -3747,6 +3747,7 @@
 	curval = dw_spinbutton_query(handle);
 	DW_MUTEX_LOCK;
 	adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)curval, (gfloat)lower, (gfloat)upper, 1.0, 5.0, 0.0);
+	gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(handle), adj);
 	DW_MUTEX_UNLOCK;
 }
 
@@ -6169,6 +6170,16 @@
 	if(!box)
 		return;
 
+		/*
+		 * If you try and pack an item into itself VERY bad things can happen; like at least an
+		 * infinite loop on GTK! Lets be safe!
+		 */
+	if(box == item)
+	{
+		dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
+		return;
+	}
+
 	DW_MUTEX_LOCK;
 
 	if((tmp  = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))
@@ -7348,6 +7359,16 @@
 	if(!box)
 		return;
 
+		/*
+		 * If you try and pack an item into itself VERY bad things can happen; like at least an
+		 * infinite loop on GTK! Lets be safe!
+		 */
+	if(box == item)
+	{
+		dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
+		return;
+	}
+
 	DW_MUTEX_LOCK;
 
 	if((tmp  = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))