diff src/glyphs-x.c @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents 5a2589c672dc
children b8cc9ab3f761
line wrap: on
line diff
--- a/src/glyphs-x.c	Mon Aug 13 11:15:00 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 11:16:07 2007 +0200
@@ -2189,6 +2189,12 @@
      need to update most other things after the items have changed.*/
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
     {
+      /* Pick up the items we recorded earlier. We do this here so
+         that the callbacks get set up with the new items. */
+      IMAGE_INSTANCE_WIDGET_ITEMS (p) =
+	IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p);
+      IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p) = Qnil;
+
       wv = gui_items_to_widget_values
 	(IMAGE_INSTANCE_WIDGET_ITEMS (p));
       wv->change = STRUCTURAL_CHANGE;
@@ -2201,6 +2207,9 @@
   /* Now do non structural updates. */
   wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p));
 
+  if (!wv)
+    return;
+
   /* Possibly update the colors and font */
   if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) 
       ||
@@ -2692,6 +2701,11 @@
       IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
     {
       widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
+
+      /* #### I don't know why this can occur. */
+      if (!wv)
+	return;
+
       update_tab_widget_face (wv, ii,
 			      IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));