PopupMenu.PopupMenu: Cinnamon Javascript Reference Manual

## PopupMenu.PopupMenu PopupMenu.PopupMenu — An actual popup menu |

## Functions

| _init ()
| setArrowSide ()
| setSourceAlignment ()
| open ()
| setMaxHeight ()
| close ()

## Properties

Boxpointer.BoxPointer | _boxPointer |
St.Bin | actor |
boolean | animating |

## Object Hierarchy

        Object
        ╰── PopupMenu.PopupMenu

## Functions

### _init ()

    _init (St.Widget   sourceActor,
           real        arrowAlignment,
           St.Side     arrowSide);

#### Parameters

sourceActor | the actor that owns the popup menu |
arrowAlignment | the position of the popup menu arrow relative to the popup menu. If 0.0, the arrow will be at the left of the popup menu. If 1.0, the arrow will be at the right of the popup menu, and numbers in between will put the arrow somewhere between the left and the right (if the popup menu opens sideways, 0.0 and 1.0 correspond to top and bottom respectively). Providing a value outside the range [0, 1] will cause unexpected behaviour. |
arrowSide | the arrow side of the menu. See `setArrowSide()` for details |

### setArrowSide ()

    setArrowSide (St.Side   side);

Sets the arrow side of the menu. Note that the side is the side of the source actor, not the menu, e.g. If St.Side.TOP is set, then the menu will appear below the source actor (the source actor will be on top of the menu)

#### Parameters

side | The new side of the menu |

### setSourceAlignment ()

    setSourceAlignment (real   alignment);

If set to 0.0, the arrow will appear at the left end of the source actor; 1.0 for right (0.0/1.0 for top/bottom for sideways arrows). The default value is 0.5, which means the arrow appears at the center of the source actor.

#### Parameters

alignment | the position of the arrow relative to the source actor. |

### open ()

    open (boolean   animate);

Opens the popup menu

#### Parameters

animate | whether the animate the open effect |

### setMaxHeight ()

    setMaxHeight ();

This function is called internally to set the max-height and max-width properties of the popup menu such that it does not grow to a size larger than the monitor. Individual popup menus can override this method to change the max height/width if they really want to.

Note that setting the max-height won't do any good if the minimum height of the menu is higher then the screen; it's useful if part of the menu is scrollable so the minimum height is smaller than the natural height.

### close ()

    close (boolean   animate);

Closes the popup menu.

#### Parameters

animate | whether the animate the close effect |

## Property Details

### The “_boxPointer” property

      “_boxPointer”          Boxpointer.BoxPointer

The box pointer object that actually draws the popup menu.

### The “actor” property

      “actor”                St.Bin

The actor of the popup menu, stolen from the `_boxPointer`.

### The “animating” property

      “animating”            boolean

Whether the popup menu is currently performing the open/close animation.