Re: [BLACKBOX] How to 'embed'

From: [at]} <Josef>
Date: Wed, 5 Oct 2011 09:06:35 +0200


I have not done this myself, but from the docu and interafces it seems that
the embedding mechanism is embodied in the module 'Containers'.
TextModels.Model extends Containers.Model and TextViews.View extends Containers.View,
for example.
So I guess your own model and corresponding view would need to be subclassed
in the same way in order to support embedding.
Good luck.
 
- Josef


----- Original Message -----
From: Douglas G. Danforth <mailto:danforth{([at]})nowhere.xy
To: BLACKBOX{([at]})nowhere.xy
Sent: Tuesday, October 04, 2011 11:47 PM
Subject: Re: [BLACKBOX] How to 'embed'

Wojtek,
I used that language because in the documentation for Models it says

"A model may be a container, i.e., contain embedded views. An embedded view can communicate with the model in which it is embedded via a Context.
A container model provides a context for each embedded view. Using its context, a view can inquire its current size, or it can try to change its size."

Josef,
You said "You can do this also with your own model but the view used for displaying your model must be aware of
embedded views and render everything accordingly."

>From that I infer that there is no general mechanism for ebbedding. Each model must handle it specifically.
Now I am up a creek since I do not know how to put a view, v(small v) at a specific place within its container
view, V(big v). I know how to do this for FormViews (again a specific case) by using a FormControllers
and using its Insert procedure which takes l, t, r, b coordinates. I tried tracking the logic of that through the
code and got lost after descending many modules.

I'll take a look at TextModels and hopefully find a way to generalize embedding in a bland view which does
not have a model (or at list a model that is extremely primitive).

Thank you.

-Doug

On 10/4/2011 1:21 AM, Josef Templ wrote:

Actually, it depends on the capabilities of the model.
A TextModels.Model, for example, provides means for
embedding an arbitray Views.View into the character stream (see TextModels.Writer.WriteView).
You can do this also with your own model but the view used for displaying your model must be aware of
embedded views and render everything accordingly.
Rendering the embedded views will typically be delegated to the embedded views, though.

- JT




----- Original Message ----- From: "Wojtek Skulski" <mailto:skulski{([at]})nowhere.xy
To: <mailto:BLACKBOX{([at]})nowhere.xy
Sent: Tuesday, October 04, 2011 6:42 AM
Subject: Re: [BLACKBOX] How to 'embed'


"embedding of one view into a model" is a self contradiction.

The model provides data "1, 2, 3, 4...". The data makes no assumptions how
it will be displayed, or whether it will be displayed at all.

The view imports the model. So it knows the details of the model (array,
record, list, double-linked-list, DAG, or any other fancy structure).
However, there is a firm assumption that no details about the display go
into the model. The model can only provide the numbers, but no details
about the display.

The Model-View separayion means the separation of concerns. The model can
calculate. The view can display the results of calculations.

Your question is breaking the separation. You are trying to put the
imported concerns back into the importee. This has to lead to circular
data structures. Hence, it is not implementable.

W.




                    Folks,

     I am old and tired of poking through documentation and code.
     So if you can please help me out it would be greatly appreciated.

     If you search the BB documentation for the word 'embed' you find
     many hits. But no where does it explicitly state the steps needed
     to do an embedding of one view into a model.

     What are the least number of steps to embed a view into a model?

     ==
     My paltry efforts center around

     Views.InstallFrame(f, view, l, t, level, focus);

     That is, given the frame (f) of the view in which one wants to embed
     the view 'view' one does the above. BUT BB complains that view
     does not have a context nor a domain. Well that is what I was
hoping
     the InstallFrame procedure would provide to view.

     So I can start and assign a context to view taken from the context
 of
     f.view.context BUT I believe that is wrong.

     Given a bare extension of Views.View with no additional structure
     TYPE View = POINTER TO RECORD(Views.View) END;
     as the container view I wish to embed arbitrary other Views.View
     as the contained view AND when the container view is restored
     (which unto itself does nothing) how do I get all of the contained
 views
     to restore themselves (or does that happen automatically OR do I
     need to forward a message)?

     Doug


 ---- 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


----
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

---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Wed Oct 05 2011 - 09:06:35 UTC

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