diff mde/gui/widget/Window.d @ 40:b28d7adc786b

Made GUI more robust to mutable data changes and improved much of GridLayoutWidget's code. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 08 May 2008 16:05:51 +0100
parents 5132301e9ed7
children b3a6ca4516b4
line wrap: on
line diff
--- a/mde/gui/widget/Window.d	Wed May 07 13:07:03 2008 +0100
+++ b/mde/gui/widget/Window.d	Thu May 08 16:05:51 2008 +0100
@@ -58,8 +58,8 @@
         assert (gui !is null, "Window.finalise ("~name~"): gui is null");
     } body {
         // Check data was loaded:
-        if (widgetData is null || mutableData is null)
-            throw new WindowLoadException ("No widget/mutable data");
+        if (widgetData is null)
+            throw new WindowLoadException ("No widget creation data");
         
         gui_ = gui;
         rend = gui.renderer;
@@ -72,6 +72,7 @@
         widget = makeWidget (0);    // primary widget always has ID 0.
         widgetData = null;  // data is no longer needed: allow GC to collect (cannot safely delete)
         
+        // Note: this should return an empty array, but nothing much should happen if it's not empty:
         widget.adjust (mutableData);    // adjust/set size, etc.
         mutableData = null;             // no longer needed
         
@@ -111,7 +112,7 @@
     } body {
         /+ NOTE: currently editing is impossible...
         if (edited) {   // only save the widget creation data if it's been adjusted:
-            addSaveData (widget);       // generate widget save data
+            addCreationData (widget);   // generate widget save data
             dlg (INTAA, WDGD, parseFrom!(int[][int]) (widgetData));
         }+/
         // Save mutable data: