MenuPositionFunc


Description:

[ CCode ( instance_pos = 4.9 ) ]
public delegate void MenuPositionFunc (Menu menu, ref int x, ref int y, out bool push_in)

A user function supplied when calling popup which controls the positioning of the menu when it is displayed.

The function sets the x and y parameters to the coordinates where the menu is to be drawn. To make the menu appear on a different monitor than the mouse pointer, set_monitor must be called.

Parameters:

menu

a Menu.

x

address of the SortColumn representing the horizontal position where the menu shall be drawn.

y

address of the SortColumn representing the vertical position where the menu shall be drawn. This is an output parameter.

push_in

This parameter controls how menus placed outside the monitor are handled. If this is set to true and part of the menu is outside the monitor then GTK+ pushes the window into the visible area, effectively modifying the popup position. Note that moving and possibly resizing the menu around will alter the scroll position to keep the menu items “in place”, i.e. at the same monitor position they would have been without resizing. In practice, this behavior is only useful for combobox popups or option menus and cannot be used to simply confine a menu to monitor boundaries. In that case, changing the scroll offset is not desirable.

user_data

the data supplied by the user in the popup data parameter.


Namespace: Gtk
Package: gtk+-3.0



2022 vala-language.org