pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Datasheet internals


From: John Darrington
Subject: Re: Datasheet internals
Date: Tue, 12 Jun 2007 13:17:03 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jun 11, 2007 at 09:34:54PM -0700, Ben Pfaff wrote:

     The model I was envisioning was this.  The GUI would interact
     primarily with a datasheet and a dictionary.  The GUI-datasheet
     shows what's in the struct datasheet, the dialog boxes work
     mostly with the dictionary, and so on.  Then, when the user told
     the GUI to do something that needed a procedure or other syntax
     to be run, the datasheet would be destructively transformed into
     a casereader with datasheet_make_reader, the casereader would be
     put into a dataset, the syntax would be run, and then the
     casereader would be extracted from the dataset and destructively
     transformed into a struct datasheet, which becomes what the GUI
     works with until the next bit of syntax needs to get run.
     
That's exactly what I had in mind too. (I keep pondering if it might
be a good idea to have the datasheet persist throughout the procedure,
and the GUI updates concurrently as the data's being written, but
that's something to be done in the future, if at all.)

The attached patch does something almost exactly what you describe. It
differs in that it uses the replace_datasheet callback instead of
waiting to the end of the procedure (this can probably change; I'm not
sure if the callbacks to struct dataset are really necessary anymore).

It also differs from your described model in that it uses
casereader_clone (inside psppire_case_file_new) to create the
datasheet.  It's not currently possible to do exactly as you describe,
since the first thing that proc_set_active_file_data does is to
destroy the existing reader, so passing that reader straight to
create_dataset would destroy it again ....

Anyway, see if you can improve on this patch.  I've noticed that FILE
NEW causes problems, and there may be a few other glitches too.  I
haven't yet fully satisfied myself that all the datasheets and
casereaders are being destroyed either.

J'



-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: p.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]