topLevel vs. open stack

Richard Gaskin ambassador at fourthworld.com
Wed Jan 14 23:55:19 EST 2004


Dan Shafer wrote:

> 
> On Jan 14, 2004, at 11:29 AM, Richard Gaskin wrote:
> 
>> Dan Shafer wrote:
>> 
>>> If I'm reading the docs correctly, topLevel should close a stack if
>>> it's open and then re-open it in an editable window UNLESS it is
>>> already open in an editable window, in which case it should merely
>>> make
>>> it the current stack. But there appears to me to be some subtle
>>> difference between sending "open" to a closed stack and sending
>>> "topLevel" to a closed stack.
>>> 
>>> Here's my basic demonstration.
>>> 
>>> Stack is open. It has a field 1 and a button. The button has a script
>>> that looks like this:
>>> 
>>> on mouseUp
>>> lock screen
>>> lock messages
>>> select field 1 of this stack
>>> copy
>>> topLevel stack "foo"
>>> paste
>>> unlock messages
>>> unlock screen
>>> end mouseUp
>>> 
>>> Clicking the button brings up stack "foo" in an editable window as
>>> documented but the paste never happens.
>>> 
>>> Simply change "topLevel" to "open" and the script works as expected.
>>> 
>>> If I begin with both stacks open, the result is identical.
>>> 
>>> So two questions arise:
>>> 
>>> 1. How if at all can I copy and paste objects between two open stacks?
>> 
>> copy field 1 to stack "MyOtherStack"
>> 
> ::sound of palm smiting forehead:: Doh! Thanks, Richard. Good one.
>> The advantage to the "copy..to" option is that it preserves the user's
>> clipboard.
>> 
>>> 2. Why does topLevel behave differently from open and from the way it
>>> seems to be documented?
>> 
>> Could the stack's style property be set?  If so then "open" will honor
>> the
>> style, while "toplevel" overrides the stack's style to open as toplevel
>> (same with the "palette", "modeless", and "modal" commands).
>> 
> Stack is a default editable stack. I do no style settings on it at all.
> 
>> What is the mode of the stack when it's opened?
>> 
>> open stack "foo"
>> answer the mode of stack "foo"
>> 
> Mode is 1

Then we might look at the other side:  What's on the clipboard after the
copy command?  

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge: Publish any database on any Web site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list