[plt-scheme] WXME Decoding Error

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Oct 11 07:39:23 EDT 2008

At Fri, 10 Oct 2008 17:42:36 -0400, Eric Domeshek wrote:
> But today I seem to have run into a bit of a brick wall in attempting to 
> use the WXME encoding/decoding piece of the framework to save and reload 
> my diagrams.  I've gotten a far as saving the data (writing a file with 
> seven types of custom snips).  Unfortunately, I can't load the data back 
> in, and the error message/trace is not helping me much.  Here's what 
> comes up in the console window when I try to load one of these saved 
> files by invoking the default File|Open command:
> 
> > insert-file in text%: error loading the file
> >
> > [...]
> >
> Can anyone suggest a way forward?  For starters, I'm not sure why 
> there's a text% floating around.  I've only been dealing with 
> pasteboard%s. 

I don't have any great ideas, but you might try parsing the file using
the `wxme' library, which might give better information about decoding
problems.

I'm puzzled by the "insert-file in text%" message, too. Looking at the
source where that message can be reported, it seems to be always within
a `text%' object, and never in a `pasteboard%'.

If you're able and willing to send me code so I can see the problem on
my machine, I would try it out.


> Also, while I'm asking questions... As I read in my data, I need to 
> create some custom structures that get wrapped inside my snips (i.e. 
> "nodes" and "links" in an underlying graph structure).  That custom data 
> all needs to be attached to a diagram-level object (the "graph").  But I 
> don't see how the read methods in my various snip-class%es can best get 
> hold of the diagram object (which is stashed in the frame%, which holds 
> the pasteboard%, which will contain the snip%s that get created by those 
> snip-class% read methods).  For now, I've got a pasteboard% on-load-file 
> method setting a global variable so my various read methods can get hold 
> of that shared diagram.  This seem ugly.  Any better ideas?

I'm not sure I understand, but I wonder whether the information should
instead reside in the pasteboard so that it's written and restored
though `write-editor-global-footer' and `read-editor-global-footer'?


Matthew



Posted on the users mailing list.