Top | ![]() |
![]() |
![]() |
![]() |
_init (St.Widget sourceActor
,real arrowAlignment
,St.Side arrowSide
);
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 (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)
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.
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.