changeset 442:7c8bd3bc6c27

Throw the warning after the mutex has been released in dw_box_pack_*
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 30 May 2003 17:36:01 +0000
parents b559c06a76c2
children e99cd6e45c0b
files gtk/dw.c
diffstat 1 files changed, 26 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Fri May 30 00:47:47 2003 +0000
+++ b/gtk/dw.c	Fri May 30 17:36:01 2003 +0000
@@ -6163,7 +6163,7 @@
  */
 void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
-	int _locked_by_me = FALSE;
+	int warn = FALSE, _locked_by_me = FALSE;
 	GtkWidget *tmp;
 
 	if(!box)
@@ -6203,11 +6203,8 @@
 		}
 		else
 		{
-            /* Only show warning if item is not a box */
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
-			if ( height == 0 && vsize == FALSE )
-				dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+			/* Only show warning if item is not a box */
+			warn = TRUE;
 		}
 
 		if(boxtype == DW_VERT)
@@ -6249,11 +6246,8 @@
 		}
 		else
 		{
-            /* Only show warning if item is not a box */
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
-			if ( height == 0 && vsize == FALSE )
-				dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+			/* Only show warning if item is not a box */
+			warn = TRUE;
 		}
 
 		gtk_container_border_width(GTK_CONTAINER(box), pad);
@@ -6265,6 +6259,14 @@
 		gtk_object_set_user_data(GTK_OBJECT(box), vbox);
 	}
 	DW_MUTEX_UNLOCK;
+
+	if(warn)
+	{
+		if ( width == 0 && hsize == FALSE )
+			dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
+		if ( height == 0 && vsize == FALSE )
+			dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+	}
 }
 
 /*
@@ -7340,7 +7342,7 @@
  */
 void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
-	int _locked_by_me = FALSE;
+	int warn = FALSE, _locked_by_me = FALSE;
 	GtkWidget *tmp;
 
 	if(!box)
@@ -7381,11 +7383,8 @@
 		}
 		else
 		{
-            /* Only show warning if item is not a box */
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
-			if ( height == 0 && vsize == FALSE )
-				dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+			/* Only show warning if item is not a box */
+			warn = TRUE;
 		}
 
 		if(boxtype == DW_VERT)
@@ -7435,11 +7434,8 @@
 		}
 		else
 		{
-            /* Only show warning if item is not a box */
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
-			if ( height == 0 && vsize == FALSE )
-				dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+			/* Only show warning if item is not a box */
+			warn = TRUE;
 		}
 
 		gtk_container_border_width(GTK_CONTAINER(box), pad);
@@ -7451,6 +7447,14 @@
 		gtk_object_set_user_data(GTK_OBJECT(box), vbox);
 	}
 	DW_MUTEX_UNLOCK;
+
+	if(warn)
+	{
+		if ( width == 0 && hsize == FALSE )
+			dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
+		if ( height == 0 && vsize == FALSE )
+			dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+	}
 }
 
 /*