From: Monroe
Subject: Help with edit boxes
Date: 
Message-ID: <36e5324a@news.inil.com>
I am writing a program that has several edit boxes that need to be filled
out with numbers and it will need to be run more than once.  Is there a way
to store the numbers so that when it is run a second time the numbers from
the first time are in the edit boxes?  That way the numbers won't have to be
entered in again.  I tried using set_tile to assign a variable to them, but
that didn't work.  Does anyone have any suggestions?  Thank you.

From: David B. Lamkins
Subject: Re: Help with edit boxes
Date: 
Message-ID: <jEbF2.14462$hC.7378010@news1.teleport.com>
In article <········@news.inil.com> , "Monroe" <··········@monroemold.com>
wrote:

> I am writing a program that has several edit boxes that need to be filled
> out with numbers and it will need to be run more than once.  Is there a way
> to store the numbers so that when it is run a second time the numbers from
> the first time are in the edit boxes?  That way the numbers won't have to be
> entered in again.  I tried using set_tile to assign a variable to them, but
> that didn't work.  Does anyone have any suggestions?  Thank you.

Suggestion #1: The next time you post a question like this, remember that
there are at least a half-dozen Lisp systems with the capability to present
a GUI.  It would help immensely if you identified which one you're using.

I can't tell from your question whether you're trying to have fields in a
dialog persist across Lisp sessions, across runs of a program, or across
appearances of the dialog.  I'm going to assume the last case.

Here's the general answer: Look for a method that runs when the dialog is
closed.  Write a specialization of that method to gather the contents of the
field that you want to persist, and save the values someplace.  Every time
the dialog runs, restore the fields from those values.

If you clarify your problem, I'm sure that someone will be able to help with
some example code.

--
David B. Lamkins <http://www.teleport.com/~dlamkins/>

Wintel is the Yugo of the computer world: cheap to buy, costly to keep.
From: Marcus Shaw
Subject: Re: Help with edit boxes
Date: 
Message-ID: <F8FsGC.6r2@liverpool.ac.uk>
In article <········@news.inil.com>, ··········@monroemold.com says...
>
>I am writing a program that has several edit boxes that need to be filled
>out with numbers and it will need to be run more than once.  Is there a way
>to store the numbers so that when it is run a second time the numbers from
>the first time are in the edit boxes?  That way the numbers won't have to be
>entered in again.  I tried using set_tile to assign a variable to them, but
>that didn't work.  Does anyone have any suggestions?  Thank you.
>
>

Hi,

I use LispWorks for Windows 4.1, but this should be applicable
to any system.

My way of working is to have a main window class which contains
a slot for the model it controls.  The main window (and thus any
dialogs from it) therefore provides a view of the model's state.
When I want the model's state to be the same as it was on its
last run I write methods to write it to a file and read it back
in again.  Whenver the model changes state I can then 'manually'
update its file (Lispworks allows objects to run a function
when they are garbage collected, but I think its safest to do it
myself when the main window closes).  I also write an
initialize-instance :after method which reads the file as soon
a new instance of the model is created.

So, run the windows program, shut it down, start it up again and
it looks just like it did last time.

Hope this is some use,

Marcus.