[REBOL] Re: layout within an object
From: sanghabum:aol at: 31-Jul-2001 4:48
> However, in the script at the end of this email, an instance variable
> gets set after the object is
> created, and if you "print myview/name" you get the value you'd expect,
> Nelson Muntz.
> But once the view is displayed, if you click the Print button, it will
> the original value of the variable,
> Edna Crabapple. It seems like the block for the Print button action is
> being evaluated when it's created
> and then not evaluated again when it's actually clicked.
I don't think I've ever quite got the hang of Rebol Contexts. And I'm still
not sure if that's me being thick or Rebol being inconsistent. But there is
a simple workaround for your code.
I always fully name variables (and function names) in VID action facets and
code the generally does what I expect. In your case, try changing:
button "Print Value" [print ["name in button action:" name]]
button "Print Value" [print ["name in button action:" myobject/name]]
That way there is no ambiguity in the name of what you are printing. (Where
the ambiguity came from in this instance is still a mystery to me).