comparison gtk/dw.c @ 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 fac2afe7bda3
children 5a0779561d0f
comparison
equal deleted inserted replaced
441:b559c06a76c2 442:7c8bd3bc6c27
6161 * vsize: TRUE if the window (widget) should expand vertically to fill space given. 6161 * vsize: TRUE if the window (widget) should expand vertically to fill space given.
6162 * pad: Number of pixels of padding around the item. 6162 * pad: Number of pixels of padding around the item.
6163 */ 6163 */
6164 void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 6164 void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
6165 { 6165 {
6166 int _locked_by_me = FALSE; 6166 int warn = FALSE, _locked_by_me = FALSE;
6167 GtkWidget *tmp; 6167 GtkWidget *tmp;
6168 6168
6169 if(!box) 6169 if(!box)
6170 return; 6170 return;
6171 6171
6201 item = eventbox; 6201 item = eventbox;
6202 } 6202 }
6203 } 6203 }
6204 else 6204 else
6205 { 6205 {
6206 /* Only show warning if item is not a box */ 6206 /* Only show warning if item is not a box */
6207 if ( width == 0 && hsize == FALSE ) 6207 warn = TRUE;
6208 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);
6209 if ( height == 0 && vsize == FALSE )
6210 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);
6211 } 6208 }
6212 6209
6213 if(boxtype == DW_VERT) 6210 if(boxtype == DW_VERT)
6214 gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); 6211 gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1);
6215 else 6212 else
6247 item = eventbox; 6244 item = eventbox;
6248 } 6245 }
6249 } 6246 }
6250 else 6247 else
6251 { 6248 {
6252 /* Only show warning if item is not a box */ 6249 /* Only show warning if item is not a box */
6253 if ( width == 0 && hsize == FALSE ) 6250 warn = TRUE;
6254 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);
6255 if ( height == 0 && vsize == FALSE )
6256 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);
6257 } 6251 }
6258 6252
6259 gtk_container_border_width(GTK_CONTAINER(box), pad); 6253 gtk_container_border_width(GTK_CONTAINER(box), pad);
6260 gtk_container_add(GTK_CONTAINER(box), vbox); 6254 gtk_container_add(GTK_CONTAINER(box), vbox);
6261 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); 6255 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0);
6263 6257
6264 gtk_widget_set_usize(item, width, height); 6258 gtk_widget_set_usize(item, width, height);
6265 gtk_object_set_user_data(GTK_OBJECT(box), vbox); 6259 gtk_object_set_user_data(GTK_OBJECT(box), vbox);
6266 } 6260 }
6267 DW_MUTEX_UNLOCK; 6261 DW_MUTEX_UNLOCK;
6262
6263 if(warn)
6264 {
6265 if ( width == 0 && hsize == FALSE )
6266 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);
6267 if ( height == 0 && vsize == FALSE )
6268 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);
6269 }
6268 } 6270 }
6269 6271
6270 /* 6272 /*
6271 * Sets the size of a given window (widget). 6273 * Sets the size of a given window (widget).
6272 * Parameters: 6274 * Parameters:
7338 * vsize: TRUE if the window (widget) should expand vertically to fill space given. 7340 * vsize: TRUE if the window (widget) should expand vertically to fill space given.
7339 * pad: Number of pixels of padding around the item. 7341 * pad: Number of pixels of padding around the item.
7340 */ 7342 */
7341 void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 7343 void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
7342 { 7344 {
7343 int _locked_by_me = FALSE; 7345 int warn = FALSE, _locked_by_me = FALSE;
7344 GtkWidget *tmp; 7346 GtkWidget *tmp;
7345 7347
7346 if(!box) 7348 if(!box)
7347 return; 7349 return;
7348 7350
7379 item = eventbox; 7381 item = eventbox;
7380 } 7382 }
7381 } 7383 }
7382 else 7384 else
7383 { 7385 {
7384 /* Only show warning if item is not a box */ 7386 /* Only show warning if item is not a box */
7385 if ( width == 0 && hsize == FALSE ) 7387 warn = TRUE;
7386 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);
7387 if ( height == 0 && vsize == FALSE )
7388 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);
7389 } 7388 }
7390 7389
7391 if(boxtype == DW_VERT) 7390 if(boxtype == DW_VERT)
7392 { 7391 {
7393 x = 0; 7392 x = 0;
7433 item = eventbox; 7432 item = eventbox;
7434 } 7433 }
7435 } 7434 }
7436 else 7435 else
7437 { 7436 {
7438 /* Only show warning if item is not a box */ 7437 /* Only show warning if item is not a box */
7439 if ( width == 0 && hsize == FALSE ) 7438 warn = TRUE;
7440 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);
7441 if ( height == 0 && vsize == FALSE )
7442 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);
7443 } 7439 }
7444 7440
7445 gtk_container_border_width(GTK_CONTAINER(box), pad); 7441 gtk_container_border_width(GTK_CONTAINER(box), pad);
7446 gtk_container_add(GTK_CONTAINER(box), vbox); 7442 gtk_container_add(GTK_CONTAINER(box), vbox);
7447 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); 7443 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0);
7449 7445
7450 gtk_widget_set_usize(item, width, height); 7446 gtk_widget_set_usize(item, width, height);
7451 gtk_object_set_user_data(GTK_OBJECT(box), vbox); 7447 gtk_object_set_user_data(GTK_OBJECT(box), vbox);
7452 } 7448 }
7453 DW_MUTEX_UNLOCK; 7449 DW_MUTEX_UNLOCK;
7450
7451 if(warn)
7452 {
7453 if ( width == 0 && hsize == FALSE )
7454 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);
7455 if ( height == 0 && vsize == FALSE )
7456 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);
7457 }
7454 } 7458 }
7455 7459
7456 /* 7460 /*
7457 * Sets the default focus item for a window/dialog. 7461 * Sets the default focus item for a window/dialog.
7458 * Parameters: 7462 * Parameters: