help needed working with modal stacks

Stephen Barncard stephenREVOLUTION at barncard.com
Wed May 3 03:55:06 EDT 2006


Well I'm working in the weird wonderful world of modal stacks, where 
you can't really change and debug in real time....

There's a bit of 'you can't get there from here.. here..

I have a custom list dialog that's almost done.

Goal: I want to be able to have NO selection in the list field happen 
before the stack opens, by using 0 or empty in the variable tLineState

I have a list field 'kMainField' on a modal dialog

This preopenstack handler in the cd 1 script of the stack will set 
the hilitedlines with line 6 of the dialogdata = "1,4,6"

When I put "1,4,6" into dialogdata then modal the stack

--- this selects lines 1,4,6 invisibly and the stack opens with those 
lines selected....

on preopenstack
    put line 6 of the dialogdata into tLineState
    set the hilitedlines of fld kMainField to it
end preopenstack



after the stack opens, I can do this in the message box:


set the hilitedlines of fld kMainField to 0

or...

set the hilitedlines of fld kMainField to empty


and unselect the line

however, if I try to pass a 0 or empty through line 6 of dialogdata, 
line 1 of the list is still selected.





if I use a custom property as a flag like this:


on preopenstack
    put line 6 of the dialogdata into tLineState
    IF (tLineState is not empty)  AND (tLineState is not 0)
     THEN
         set the hilitedlines of fld kMainField to it
         set the hLines of this stack to true
     ELSE
         set the hLines of this stack to false
     END IF  
end preopenstack


and then in the stack script use this handler:

ON openstack
     IF the hlines of this stack is false
     THEN
         set the hilitedlines of fld "listField" to empty
     END IF
END openstack


I can get the line to unselect, however it's selected for a second 
before it un-selects...

This looks like crap though.

using "send in time" doesn't work either.

Is this a bug?

I can do other things like delete a line from the field from the 
preopenstack handler or just about anything else... why not this?



by the way.... did you know that dialogdata can't be an array? Bummer.

thanks for any suggestions...
sqb



-- 
stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -


More information about the use-livecode mailing list