comparison 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
comparison
equal deleted inserted replaced
446:ab549e2f34b9 447:5a0779561d0f
3745 int _locked_by_me = FALSE; 3745 int _locked_by_me = FALSE;
3746 3746
3747 curval = dw_spinbutton_query(handle); 3747 curval = dw_spinbutton_query(handle);
3748 DW_MUTEX_LOCK; 3748 DW_MUTEX_LOCK;
3749 adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)curval, (gfloat)lower, (gfloat)upper, 1.0, 5.0, 0.0); 3749 adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)curval, (gfloat)lower, (gfloat)upper, 1.0, 5.0, 0.0);
3750 gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(handle), adj);
3750 DW_MUTEX_UNLOCK; 3751 DW_MUTEX_UNLOCK;
3751 } 3752 }
3752 3753
3753 /* 3754 /*
3754 * Sets the entryfield character limit. 3755 * Sets the entryfield character limit.
6166 int warn = FALSE, _locked_by_me = FALSE; 6167 int warn = FALSE, _locked_by_me = FALSE;
6167 GtkWidget *tmp; 6168 GtkWidget *tmp;
6168 6169
6169 if(!box) 6170 if(!box)
6170 return; 6171 return;
6172
6173 /*
6174 * If you try and pack an item into itself VERY bad things can happen; like at least an
6175 * infinite loop on GTK! Lets be safe!
6176 */
6177 if(box == item)
6178 {
6179 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
6180 return;
6181 }
6171 6182
6172 DW_MUTEX_LOCK; 6183 DW_MUTEX_LOCK;
6173 6184
6174 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) 6185 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))
6175 box = tmp; 6186 box = tmp;
7345 int warn = FALSE, _locked_by_me = FALSE; 7356 int warn = FALSE, _locked_by_me = FALSE;
7346 GtkWidget *tmp; 7357 GtkWidget *tmp;
7347 7358
7348 if(!box) 7359 if(!box)
7349 return; 7360 return;
7361
7362 /*
7363 * If you try and pack an item into itself VERY bad things can happen; like at least an
7364 * infinite loop on GTK! Lets be safe!
7365 */
7366 if(box == item)
7367 {
7368 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
7369 return;
7370 }
7350 7371
7351 DW_MUTEX_LOCK; 7372 DW_MUTEX_LOCK;
7352 7373
7353 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) 7374 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))
7354 box = tmp; 7375 box = tmp;