<br>Is it possible to use Marshal with wxruby classes to serialize an application&#39;s state?<br><br>I tried a minimal example of simply serializing a minimal frame object, and I get the error &quot;no marshal_dump is defined for class MinimalFrame&quot;.
<br><br>I don&#39;t fully understand this because I also tried another minimal example of dumping a class which did not defined a marshal_dump, and it worked fine.&nbsp; Is there some reason this has been disabled in wxruby classes?&nbsp; Sorry, I picked up ruby a few days ago so I may be missing something obvious.
<br><br>Here&#39;s a test program showing that the simple class will serialize but the simple frame will not.<br><br>#!/usr/bin/env ruby<br><br>require &#39;wx&#39;<br>include Wx<br><br>class MinimalClass<br>&nbsp; def initialize
<br>&nbsp;&nbsp;&nbsp; @data = 1234<br>&nbsp; end<br><br>&nbsp; def save<br>&nbsp;&nbsp;&nbsp; File.open(&quot;dump-class&quot;,&quot;w+&quot;) do |f|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Marshal.dump(self, f)<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br><br>end<br><br>class MinimalFrame &lt; Frame<br>&nbsp; def initialize(title)
<br>&nbsp;&nbsp;&nbsp; # The main application frame has no parent (nil)<br>&nbsp;&nbsp;&nbsp; super(nil, :title =&gt; title, :size =&gt; [ 700, 400 ])<br>&nbsp;&nbsp;&nbsp; @data = 1234<br>&nbsp; end<br><br>&nbsp; def save<br>&nbsp;&nbsp;&nbsp; File.open(&quot;dump-frame&quot;,&quot;w+&quot;) do |f|
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Marshal.dump(self, f)<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br><br>end<br><br><br>App.run do<br><br>&nbsp; obj = MinimalClass.new<br>&nbsp; obj.save<br><br>&nbsp; self.app_name = &#39;Minimal&#39;<br>&nbsp; frame = MinimalFrame.new(&quot;Minimal wxRuby App&quot;)
<br>&nbsp; frame.save<br>end<br><br>