position_widget


Description:

public void position_widget (Widget menu_widget, Widget? attach_widget, out int x, out int y)

Computes the x and y coordinates to position the menu_widget relative to attach_widget.

If attach_widget is NULL, the computed position will be relative to this.

Note that if the panel is hidden (autohide), you should delay calling this function until the panel is shown, so that it returns the correct coordinates.

This function is intended for custom menu widgets and should rarely be used since 4.19.0. For a regular Menu you should use popup_menu instead, and for a Window popup_window, which take care of positioning for you, among other things.

See also: popup_menu and popup_window.

Parameters:

this

an PanelPlugin.

menu_widget

a Widget that will be used as popup menu.

attach_widget

a Widget relative to which the menu should be positioned.

x

return location for the x coordinate.

y

return location for the y coordinate.