Sticky popup?
dfepstein at comcast.net
dfepstein at comcast.net
Thu Mar 4 10:22:26 EST 2010
Scott Rossi asked "Is there any way to make the action of popping up a menu "sticky"?"
To imitate a "sticky popup" I show a stack (named here "L9nav") with empty decorations, whose buttons trigger the desired actions and cause the stack to close. And I include in the stack an invisible graphic named "auto" whose script, when in use, causes the stack to close when there's a click somewhere outside the stack.
On mousedown:
insert script of graphic "auto" of stack "L9nav" into front
go stack "L9nav" as palette
Graphic "auto" has this script:
on focusIn
get the short name of this stack
if it is not "L9nav" then close stack "L9nav"
pass focusIn
end focusIn
on openField
get the short name of this stack
if it is not "L9nav" then close stack "L9nav"
pass openField
end openField
And "L9nav" itself has this script:
on closeStack
if there is not a graphic "auto" then exit closeStack
get the long name of graphic "auto"
remove script of it from front
end closeStack
David Epstein
More information about the use-livecode
mailing list