title: Saving and loading a dynamic gWidgets GUI
body: <p>I have a dynamic GUI created using gWidgets package in R (guiToolkit="RGtk2" if it matters). By dynamic I mean that form elements are created and removed while using the GUI. I wonder if there is a simple way to save the current GUI with all the current form elements and selected/typed values, and then load it later. Saving and loading a workspace doesn't seem to work for this kind of things, for example:</p>
  
  <pre><code>require (gWidgets)
  options (guiToolkit="RGtk2")
  win1 &lt;- gwindow("Test")
  svalue(win1) &lt;- "Window 1"
  win2 &lt;- win1
  svalue(win2) &lt;- "Window 2"
  visible(win1)=FALSE
  visible(win2)=TRUE
  </code></pre>
  
  <p>Works fine, you can copy an object and it continues working under other variable name. But when you save the workspace and load it you get an error "assertion `GTK_IS_WIDGET (widget)' failed" when trying to execute last 2 lines. So, load() function doesn't recreate the object properly.</p>