Re: [BLACKBOX] Opening an embedded form view

From: [at]} <Antony>
Date: Mon, 14 Dec 2009 03:03:01 -0800


I wrote earlier: "The design pattern for me is creating a form that has a graphic that changes when the values of variables are changed. If I want to store the way it looks for a particular set of values, I would have to print it to a file as a pdf or ps file."

Am I correct in the distinction of using a model is that it allows storing a particular instantiation? In other words, the module SolarTestgraph that I created without a model allows opening the form, but each time I do, the value of yIntercept and slope are initialized as in the module. Had I implemented it with a model, I could store documents which could have distinct values for those parameters, and when opened would show the graph associated with those values.

I'm not sure I understand, especially since the documentation for Views says: "Internalize, Externalize must be implemented in views which contain persistent mutable data. In this case, a view without model should also implement the CopyFromSimpleView procedure, while a view with a model should implement the CopyFromModelView procedure instead.", which would seem to contradict the distinction I postulate above. Is it a distinction that only becomes clear with a more complicated example?


On Mon, Dec 14, 2009 at 12:24 AM, Robert <robert.campbell_{([at]})nowhere.xy


Douglas G. Danforth wrote:


Robert, Antony, Josef,

My first response to your code was, 'Yuk!, no way!'.
Sorry that's just how I responded. I don't think it is necessary to
use a model.



I don't know if (*you*) want a Model; it depends on what (*your*) View does/contains. You said it contains a 'Graph'; I just surmised that a

Graph might be a Model.

As I indicated in my email not using a Model would simplfy my example (but not by a lot, maybe by 4 1-line methods). The example certainly does not need a Model.


I gave a Model example as it is obvious how to simplify it if you don't want a Model. Generalising a View only example to include a Model is less obvious.


I remember the 'Yuk' feeling when you first see so many routines. But each routine is very short, and has a very simple task.

You still seem to be having problems maintaining state:


"Unfortunately I can't get your suggestion to work (yet).
"If I just open the form I don't get the right behavior.
"Things are not initialized properly.
"I still need to find the pointer in the form and then set all of
"its fields correctly.


The standard, and once used to it very simple, technique is to use the three Methods Externalize, Internalize, & CopyFrom.



Robert


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Mon Dec 14 2009 - 12:03:01 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:38 UTC