Deutsches LiveCode Wiki
Advertisement

Displays a stack as a drawer of another stack. Use the drawer command to slide a stack out of one edge of another stack.

Type: command

Syntax:

drawer stack {[at] left | bottom | right} [{of | in} parentStack] [aligned [to] {left | right | top | bottom | center}]

Examples:

drawer stack "Recent Transactions" at right
drawer stack "Tips" at left of stack "Main" aligned to top
drawer me at bottom aligned to left
drawer stack "Help List" at right of this stack
drawer stack "Connections" at right aligned to center

The stack is any stack reference.

The parentStack is any reference to a stack in an open window.

Comments: The drawer command opens the stack as a drawer of the specified parentStack. (The stack's rectangle and location properties are ignored.)

You can open a drawer at the left, bottom, or right edge of the parentStack. If you don't specify an edge, the drawer opens at the left if there is room for it to fully open. Otherwise, it opens at the right.

You can align a drawer to the top, bottom, or center (of the parentStack's left or right edge) or to the left, right, or center (of the bottom edge). If you don't specify an alignment, the drawer is aligned to the center of the specified edge. To let the user access multiple drawers on one side of a window, align them to different locations on that side:

 drawer "Basic Tools" at left of this stack aligned to top
 drawer "Colors" at left of this stack aligned to bottom

Cross-platform note: On Mac OS, Unix, and Windows systems, drawers are not supported, so the drawer command opens the stack as a palette instead. The palette uses the current rectangle of the stack and does not resize or move it.

To slide the drawer back in, either close the stack or hide it:

 close stack "Colors"
 hide stack "Colors"

If the stack is already open, the drawer command closes the stack and reopens it as a drawer, so closeStack and openStack, closeCard and openCard, and (if applicable) closeBackground and openBackground messages are sent to the current card as a result of executing this command. Use the lock messages command before executing drawer if you want to prevent the close messages from being sent; the open messages are sent regardless of the setting of the lockMessages property.

See Also: go Command, mode Property, palette Command, topLevel Command

Advertisement