Datagrids and Nested Behaviors

Richard Gaskin ambassador at fourthworld.com
Fri Jul 20 18:31:38 EDT 2018


Bob Sneidar wrote:
 > So far as I have been able to ascertain, "me" always refers to the
 > original object, and NOT the behavior. As Jacques so helpfully pointed
 > out, "this me" refers to the behavior's own script. So "me" might be
 > thought of as a synonym for "the target" (insofar as I have been able
 > to work it out).

Useful when that's what you want to do, but not something that can help 
for overloading an existing behavior script which expects to able to 
address controls relative to "me".


 > I've been working with nested behaviors for a datagrid the better part
 > of this day, since discovering how to do it, (thank you Bernd for your
 > input on this) and the datagrid default behavior seems to be working
 > as advertised, and behaving exactly as your diagram describes.

IIRC Bernd's suggestion was for global scope only, yes?  That is, it 
swaps the positions of the two bottom scripts shown below, and affects 
all DGs running in the session.

I can't think of another way to do it, but it would be nice to be able 
to overload some DGs while leaving others alone.


 >> On Jul 20, 2018, at 13:26 , Richard Gaskin wrote:
 >>
 >> I just realized why the method most useful for controlling scope 
won't actually work.
 >>
 >> For scoping, we want only some DGs to have custom behavior, so this 
would seem most desirable:
 >>
 >>      [ DataGrid ]
 >>           |
 >>           V
 >>   [ Custom Behavior ]
 >>           |
 >>           V
 >> [ Standard DG Behavior ]
 >>
 >>
 >> Useful as that it for limiting scope, the problem is that much of the
 >> DG code refers to objects within "me", and in this setup "me" refers
 >> to the Custom Behavior object rather than the original DG group.  No
 >> subgroups, fields, or anything else the DG expects to find are
 >> present in the Custom Behavior object, resulting in script errors.
 >>
 >> So the only way I can see this working at all is to toss scope
 >> control out the door and swap the Custom Behavior to be the behavior
 >> object for the Standard DG Behavior, as I believe Panos had suggested
 >> earlier.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list