Top |
|
_init () |
|
setArrowSide () |
|
setOrientation () |
|
setCustomStyleClass () |
|
setSourceAlignment () |
|
open () |
|
close () |
|
shiftToPosition () |
|
setMaxHeight () |
_init (St.Widget sourceActor
,St.Side orientation
);
sourceActor |
the actor that owns the popup menu |
|
orientation |
the side of the menu that will be attached to |
setArrowSide (St.Side side
);
Sets the orientation of the sourceActor
with respect to the menu. This function is deprecated and kept for compatibility with older code. Please use setOrientation
instead.
setOrientation (St.Side orientation
);
Sets the orientation of the sourceActor
with respect to the menu. For example, if you use St.Side.TOP, the menu will try to place itself below the sourcActor
unless there is not enough room for it.
setCustomStyleClass (string className
);
Adds a custom class name to the menu which allows it to be styled separately from other menus.
setSourceAlignment (real alignment
);
Since the boxpointer was removed from the menu, this function now does nothing. Please do not use this function in new code.
shiftToPosition (number slidePosition
);
This function specifies a new position at which to center the menu. The position is given in coordinates relative to the sourceActor
, and as such should always be positive. This is useful if, for example, you want the menu to open at the location of a mouse click rather than at the center of the actor. This function only moves the menu along one axis as determined by the orientation of the menu, so that the menu is always attached to the sourceActor
. For example, if the orientation is set to St.Side.TOP, this function will move the center along the x axis. If you have set the slidePosition
using this function and then wish to return to centering the menu on the center of the sourceActor
, you can do so by setting it to -1.
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.
“animating”
property “animating” boolean
Whether the popup menu is currently performing the open/close animation.
“slidePosition”
property “slidePosition” number
Position relative to the sourceActor
of the menu upon which the menu will be centered (if possible). If -1, the menu will be centered on the sourceActor
. See shiftToPosition
for more details.