# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1054316161 0 # Node ID 7c8bd3bc6c271e3f8158fda8105718168a799064 # Parent b559c06a76c2d52b296937c201a70e41ceccba0d Throw the warning after the mutex has been released in dw_box_pack_* diff -r b559c06a76c2 -r 7c8bd3bc6c27 gtk/dw.c --- 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); + } } /*