Palette command problem

Richard Gaskin ambassador at fourthworld.com
Fri May 20 10:23:58 EDT 2016


Kay C Lan wrote:

 > Here on OSX 10.9.5 LC 8.0.1 rc 1 if I open a 'topLevel' stack and in
 > the message box:
 >
 >    palette stack "guineapig"
 >
 > the stack is palettised. But if I put this in the message box:
 >
 >    put the style of stack "guineapig"
 >
 > the result is: topLevel ??
 >
 > If I revert the stack back to topLevel and in the message box:
 >
 >    set the style of stack "guineapig" to palette
 >
 > it works, and if I then:
 >
 > put the style of stack "guineapig"
 >
 > the result is: palette
 >
 > Something definitely not right. Anyone else seeing the command
 >
 >    palette stack "yourNameHere"

This all seems fine, given the unique roles of style and mode.

The style property is persistent, saved with the stack.  It's toplevel 
by default, but can be changed to modeless, modal, or palette.  When a 
stack is opened without specifying a mode name (as with "go" or "open") 
the stack will be opened in the mode determined by its style property.

At any time we can override the stack's style property by using a style 
name as a command, such as palette, modeless, etc. e.g.:

   palette "SomeStack"

Using a style name as a command will open the stack in the specified 
mode, but will not alter the persistent "style" property.  This is 
especially useful for things like palettes, so you can simply open them 
with "open" and when you want to work on them you can use the "toplevel" 
style name as a command:

   toplevel "SomeStack"

To determine the actual mode in use by a stack at any given time, use 
the stack's mode property.  This is determined at runtime and is 
read-only, an integer reflecting any of the various states a stack can 
be in.  Style names are not used here as the mode property covers a 
broader range of circumstances than a stack's style property, including 
a toplevel stack that has its cantModify set to true (2) as opposed to 
editable (1), or closed but still in memory (0).  Palettes will have a 
mode of 4.

It may be helpful to have mode listed among the See Also tokens in the 
Dictionary entry for the Style property.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list