Can't set hilitedLine inside openStack
André Bisseret
andre.bisseret at wanadoo.fr
Wed Jun 19 04:48:50 EDT 2013
Bonjour Paul,
Not sure to have understood well your problem but:
I just made a new main stack "stackMain" and a substack of it named "bar"
On stack "stackMain" a button with the following handler :
on mouseUp
modal stack "bar"
end mouseUp
On the substack "bar", I put a field "foo" with several lines of text
setting the lockText to true and listBehavior to true.
the script of the field "foo" is :
on selectionChanged
global gLineNum,
------
put the hilitedLine of me into gLineNum
end selectionChanged
The script of the substack "bar" is :
on openStack
global gLineNum,
------
if gLineNum > 1 then
set the hilitedLine of fld "foo" to gLineNum
else
set the hilitedLine of fld "foo" to 0
end if
end openStack
And on the substack a button which allow to close it :
on mouseUp
close stack "bar"
end mouseUp
select a line in field "foo",
close the substack "
reopen it : the hilitedLIne of field "foo" is as expected
Does that help ?
Best regards from Grenoble
André
Le 19 juin 2013 à 01:01, Paul D. DeRocco a écrit :
> I have a modal stack that contains a listbox used to select something, and I
> keep track of the last selection made in a global variable. I want the stack
> to pop up with the last selection already highlighted, or no line
> highlighted if there is no matching line. So I compute the number of the
> matching line in a variable, or "empty" if there is no match, and then do
>
> set the hilitedLine of field "foo" of stack "bar" to n
>
> It does bupkis; no matter what, the first line remains selected. If I set a
> breakpoint on this line, and open the stack manually (i.e., non-modally so
> that it will actually trigger the break), I can see that n contains the
> correct value. When I step across the above statement, nothing happens. If I
> then type exactly the same statement into the Message Box, the proper line
> is highlighted. What the heck is going on?
>
> --
>
> Ciao, Paul D. DeRocco
> Paul mailto:pderocco at ix.netcom.com
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list