-------------------
What's the best way to get a palette button to work on another stack? In
HyperCard, you could refer to an object (e.g. "field 1") in a
palette-button's handler and it would be obvious that this would refer to
that object on the current card (of the current stack). However, in
Revolution, palettes are stacks, so it's not so easy.
With a bit of digging around the Transcript Dictionary ("defaultStack",
"mainStack", "mainStacks()", "stacks()", "stackFiles", "topStack()"
[="currentWindow()"], "openStacks()" [="windows()"],
"revLoadedStacks(application)" !) I came up with the following handler,
which works. It's to toggle the lock property of all fields on a card:on mouseUp
put the short name of the topStack into activeStack
lock screen
lock messages
push cd
go activeStack
repeat with i=1 to the number of flds
set cursor to busy
set lockText of fld i to not (lockText of fld i)
end repeat
pop cd
end mouseUpInterestingly, it also seems to work even if the "palette" stack is made
"topLevel". (I expected it would have regarded itself as the topStack but
there you go.)
Is this the way you're meant to do it? It seems a little clumsy - especially with the lock screen; push cd; go...; pop cd stuff.
Thanks,
Jonathan Cooper Manager of Information / Website Art Gallery of New South Wales Sydney, Australia http://www.artgallery.nsw.gov.au
_______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
