Package: gtk

Callback gtk-menu-position-func

Details

A user function supplied when calling the gtk-menu-popup function 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, the gtk-menu-monitor function must be called.
 lambda (menu x y push)  
menu
A gtk-menu widget.
x
A pointer to the integer representing the horizontal position where the menu shall be drawn.
y
A pointer to the integer representing the vertical position where the menu shall be drawn.
push
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.
 

See also

2021-11-14