diff win/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 faaeec0dba1d
children e81af9e60697
line wrap: on
line diff
--- a/win/dw.c	Tue Jun 03 09:08:33 2003 +0000
+++ b/win/dw.c	Tue Jun 03 09:13:35 2003 +0000
@@ -4732,6 +4732,16 @@
 {
 	Box *thisbox;
 
+		/*
+		 * 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;
+	}
+
 	thisbox = (Box *)GetWindowLongPtr(box, GWLP_USERDATA);
 	if(thisbox)
 	{
@@ -7531,6 +7541,16 @@
 {
 	Box *thisbox;
 
+		/*
+		 * 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;
+	}
+
 	thisbox = (Box *)GetWindowLongPtr(box, GWLP_USERDATA);
 	if(thisbox)
 	{