[ALLY] Re: Redrawn Out
From: mike:myers:cybarite at: 7-Jan-2001 9:05
1/6/01 9:24:03 AM, "Carl Sassenrath" <[carl--pacific--net]> wrote:
>I don't like thinking about how old those docs are, or in fact how old view
>to what we run these days in Link.
>If I understand correctly, you want to display the object field in a window.
>is very easy to do in View:
>view layout [
> h2 "User Input:"
> txt 80 "First Name"
> txt 160 user-input/first-name
> txt 80 "Last Name"
> txt 160 user-input/last-name
Thanks for taking this time to respond.
My question is not on the display basics. I think the basics are there in the easyvid.r
examples. And fortunately, I am
past that level now. And I think the use of styles is one of the key leverage points
in View. Super job!
My question is avoiding the work to refresh values on the view-able portion.
Here is the reference from the old View documentation:
The redraw function is called immediately before a face is displayed. This allows a face
to dynamically alter any of its facets prior to being displayed. This
is how screen interacters (buttons, choices, etc.) reflect their current state to the
user. For example, a button might be displayed as either up or down
depending on the state of a variable that has been set. The redraw variable should be
set to none if no function is needed. This speeds up the interface
by not calling needless functions.
If I hold values in memory in an object or store them to a database or change them in
other faces, then when
I want to display them, I want the current / correct value to be displayed.
If I understand correctly ... which is not a given ... because layout is a layout tool,
then the user interface is defined once.
Changing the value held in the model (the object) does not change the values in the view.
The /View examples that I have seen have been using a "Passive Model" as noted in the
Model-View-Controller notes that I reference.
See : http://burks.bton.ac.uk/burks/language/smaltalk/mvc.htm
Without some /View support, I would have to know before viewing a face that I have to
refresh the display values in that view
from those held in the model. Aside from the tedious error prone nature of this, it
seems fundamentally flawed as an approach.
I concluded that this is not what was intended in the /View architecture. And the old
/View documentation seemed to support this
as noted in the clip from the redraw section of the View html documentation.
The MVC documentation refers to an approach called DependentFields which, as far as I
know, does not have a parallel in /View.
My question then with this background is whether REBOL/View or REBOL/Link provides a
parallel to this DependentFields approach.
If not is it planned or is there a workable solution to implement aside from the custom
style approach that I proposed i.e.
bound-Faces: stylize [
bound-txt: txt with [
append feel/redraw [texts/1] ; I haven't tried this yet .... it is trying to use
the first text argument to the interacter as code.
Then I coud use :
view layout [across
tab txt "First Name: " bound-txt "text: myObject/name-first"
return tab txt "Last Name: " bound-txt "text: myObject/name-last"
] ; when these displays are re-drawn they will always display the value held in assigned
but this is not an "A" grade solution.