Page 1 of 1

setting a stack as palette

Posted: Fri Nov 07, 2008 12:48 am
by billworld
Why is the following stack script giving me a topLevel window rather than a palette when I open the sub-stack by double-clicking on the substack in the app browser?

Code: Select all

on openstack
   go stack "MyStack" as palette
end openstack
I suspect it has something to do with message order as it specifically pertains to window types. Although, other commands can be initiated via this method of navigation.

Posted: Fri Nov 07, 2008 8:59 am
by SparkOut
Maybe the style of the substack has been set?
Rev Dictionary wrote: Important! The style of the stack, if it is anything other than "topLevel", overrides any mode you specify in a go command. For example, if you open a stack using the statement go stack "Some Stack" as modeless, and the style of "Some Stack" is set to "palette", it opens as a palette rather than a modeless dialog box, ignoring the mode you specified.
If you try

Code: Select all

palette "MyStack"
does that work? (Look up "palette" in the dictionary to see the notes about how the messages are affected by this command)

Posted: Fri Nov 07, 2008 2:25 pm
by billworld

Code: Select all

palette "MyStack"
has the same effect. Anyway, it's just odd. Regardless, the palette is correctly set when accessing the sub-stack from a button (which is how the app will work). It's just confusing that opening it via the App Browser doesn't observe the palette command. Maybe intentionally to help with editing?

SparkOut wrote:Maybe the style of the substack has been set?
Rev Dictionary wrote: Important! The style of the stack, if it is anything other than "topLevel", overrides any mode you specify in a go command. For example, if you open a stack using the statement go stack "Some Stack" as modeless, and the style of "Some Stack" is set to "palette", it opens as a palette rather than a modeless dialog box, ignoring the mode you specified.
If you try

Code: Select all

palette "MyStack"
does that work? (Look up "palette" in the dictionary to see the notes about how the messages are affected by this command)

Posted: Fri Nov 07, 2008 2:50 pm
by BvG
billworld wrote:Maybe intentionally to help with editing?
You can look at the scripts of all IDE components (if you have set one of the relevant settings) I have it set to open scripts of all stacks (even IDE ones) when I alt-ctrl-right click. In the mouseDoubleUp handler you'll find the following code:

Code: Select all

   default
      if not the visible of stack tStack then show stack tStack
      if the style of stack tStack is not "toplevel"
      then set the style of stack tStack to "toplevel"
      else toplevel stack tStack
      break
    end switch
So most likely you're right with your assumption.

Posted: Fri Nov 07, 2008 3:22 pm
by billworld
Got it. Thanks. I haven't yet ventured into exploring the IDE code. Still getting up-to-speed on everything else. But, I'll have to learn how to go there when IDE oddities arise. Thanks.
BvG wrote:
billworld wrote:Maybe intentionally to help with editing?
You can look at the scripts of all IDE components (if you have set one of the relevant settings) I have it set to open scripts of all stacks (even IDE ones) when I alt-ctrl-right click. In the mouseDoubleUp handler you'll find the following code:

Code: Select all

   default
      if not the visible of stack tStack then show stack tStack
      if the style of stack tStack is not "toplevel"
      then set the style of stack tStack to "toplevel"
      else toplevel stack tStack
      break
    end switch
So most likely you're right with your assumption.