gi-gtk-4.0.1: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Menu

Description

A Menu is a MenuShell that implements a drop down menu consisting of a list of MenuItem objects which can be navigated and activated by the user to perform application functions.

A Menu is most commonly dropped down by activating a MenuItem in a MenuBar or popped up by activating a MenuItem in another Menu.

A Menu can also be popped up by activating a ComboBox. Other composite widgets such as the Notebook can pop up a Menu as well.

Applications can display a Menu as a popup menu by calling one of the gtk_menu_popup_*() function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.

Connecting the popup signal handler.

C code

 // connect our handler which will popup the menu
 gesture = gtk_gesture_multi_press_new (window);
 gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture),
                                GDK_BUTTON_SECONDARY);
 g_signal_connect (gesture, "begin", G_CALLBACK (my_popup_handler), menu);

Signal handler which displays a popup menu.

C code

static void
my_popup_handler (GtkGesture       *gesture,
                  GdkEventSequence *sequence
                  gpointer          data)
{
  GtkMenu *menu = data;
  const GdkEvent *event;

  event = gtk_gesture_get_last_event (gesture, sequence);
  gtk_menu_popup_at_pointer (menu, event);
}

CSS nodes

plain code

menu
├── arrow.top
├── <child>
┊
├── <child>
╰── arrow.bottom

The main CSS node of GtkMenu has name menu, and there are two subnodes with name arrow, for scrolling menu arrows. These subnodes get the .top and .bottom style classes.

Synopsis

Exported types

newtype Menu Source #

Memory-managed wrapper type.

Constructors

Menu (ManagedPtr Menu) 

Instances

Instances details
Eq Menu Source # 
Instance details

Defined in GI.Gtk.Objects.Menu

Methods

(==) :: Menu -> Menu -> Bool #

(/=) :: Menu -> Menu -> Bool #

IsGValue Menu Source #

Convert Menu to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Menu

GObject Menu Source # 
Instance details

Defined in GI.Gtk.Objects.Menu

Methods

gobjectType :: IO GType #

HasParentTypes Menu Source # 
Instance details

Defined in GI.Gtk.Objects.Menu

type ParentTypes Menu Source # 
Instance details

Defined in GI.Gtk.Objects.Menu

class (GObject o, IsDescendantOf Menu o) => IsMenu o Source #

Type class for types which can be safely cast to Menu, for instance with toMenu.

Instances

Instances details
(GObject o, IsDescendantOf Menu o) => IsMenu o Source # 
Instance details

Defined in GI.Gtk.Objects.Menu

toMenu :: (MonadIO m, IsMenu o) => o -> m Menu Source #

Cast to Menu, for types for which this is known to be safe. For general casts, use castTo.

noMenu :: Maybe Menu Source #

A convenience alias for Nothing :: Maybe Menu.

Methods

Overloaded methods

attachToWidget

menuAttachToWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsWidget b) 
=> a

menu: a Menu

-> b

attachWidget: the Widget that the menu will be attached to

-> Maybe MenuDetachFunc

detacher: the user supplied callback function that will be called when the menu calls menuDetach

-> m () 

Attaches the menu to the widget and provides a callback function that will be invoked when the menu calls menuDetach during its destruction.

If the menu is attached to the widget then it will be destroyed when the widget is destroyed, as if it was a child widget. An attached menu will also move between screens correctly if the widgets moves between screens.

detach

menuDetach Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m () 

Detaches the menu from the widget to which it had been attached. This function will call the callback function, detacher, provided when the menuAttachToWidget function was called.

getAccelGroup

menuGetAccelGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m AccelGroup

Returns: the AccelGroup associated with the menu

Gets the AccelGroup which holds global accelerators for the menu. See menuSetAccelGroup.

getAccelPath

menuGetAccelPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a valid Menu

-> m Text

Returns: the accelerator path set on the menu.

Retrieves the accelerator path set on the menu.

getActive

menuGetActive Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m Widget

Returns: the MenuItem that was last selected in the menu. If a selection has not yet been made, the first menu item is selected.

Returns the selected menu item from the menu. This is used by the ComboBox.

getAttachWidget

menuGetAttachWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m Widget

Returns: the Widget that the menu is attached to

Returns the Widget that the menu is attached to.

getForAttachWidget

menuGetForAttachWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) 
=> a

widget: a Widget

-> m [Widget]

Returns: the list of menus attached to his widget.

Returns a list of the menus which are attached to this widget. This list is owned by GTK+ and must not be modified.

getMonitor

menuGetMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m Int32

Returns: the number of the monitor on which the menu should be popped up or -1, if no monitor has been set

Retrieves the number of the monitor on which to show the menu.

getReserveToggleSize

menuGetReserveToggleSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m Bool

Returns: Whether the menu reserves toggle space

Returns whether the menu reserves space for toggles and icons, regardless of their actual presence.

new

menuNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Menu

Returns: a new Menu

Creates a new Menu

newFromModel

menuNewFromModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuModel a) 
=> a

model: a MenuModel

-> m Menu

Returns: a new Menu

Creates a Menu and populates it with menu items and submenus according to model.

The created menu items are connected to actions found in the ApplicationWindow to which the menu belongs - typically by means of being attached to a widget (see menuAttachToWidget) that is contained within the GtkApplicationWindows widget hierarchy.

Actions can also be added using widgetInsertActionGroup on the menu's attach widget or on any of its parent widgets.

placeOnMonitor

menuPlaceOnMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMonitor b) 
=> a

menu: a Menu

-> b

monitor: the monitor to place the menu on

-> m () 

Places menu on the given monitor.

popdown

menuPopdown Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m () 

Removes the menu from the screen.

popupAtPointer

menuPopupAtPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsEvent b) 
=> a

menu: the Menu to pop up

-> Maybe b

triggerEvent: the GdkEvent that initiated this request or Nothing if it's the current event

-> m () 

Displays menu and makes it available for selection.

See gtk_menu_popup_at_widget () to pop up a menu at a widget. gtk_menu_popup_at_rect () also allows you to position a menu at an arbitrary rectangle.

menu will be positioned at the pointer associated with triggerEvent.

Properties that influence the behaviour of this function are Menu:anchor-hints, Menu:rect-anchor-dx, Menu:rect-anchor-dy, and Menu:menu-type-hint. Connect to the poppedUp signal to find out how it was actually positioned.

popupAtRect

menuPopupAtRect Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsSurface b, IsEvent c) 
=> a

menu: the Menu to pop up

-> b

rectSurface: the Surface rect is relative to

-> Rectangle

rect: the Rectangle to align menu with

-> Gravity

rectAnchor: the point on rect to align with menu's anchor point

-> Gravity

menuAnchor: the point on menu to align with rect's anchor point

-> Maybe c

triggerEvent: the GdkEvent that initiated this request or Nothing if it's the current event

-> m () 

Displays menu and makes it available for selection.

See gtk_menu_popup_at_widget () and gtk_menu_popup_at_pointer (), which handle more common cases for popping up menus.

menu will be positioned at rect, aligning their anchor points. rect is relative to the top-left corner of rectSurface. rectAnchor and menuAnchor determine anchor points on rect and menu to pin together. menu can optionally be offset by Menu:rect-anchor-dx and Menu:rect-anchor-dy.

Anchors should be specified under the assumption that the text direction is left-to-right; they will be flipped horizontally automatically if the text direction is right-to-left.

Other properties that influence the behaviour of this function are Menu:anchor-hints and Menu:menu-type-hint. Connect to the poppedUp signal to find out how it was actually positioned.

popupAtWidget

menuPopupAtWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsWidget b, IsEvent c) 
=> a

menu: the Menu to pop up

-> b

widget: the Widget to align menu with

-> Gravity

widgetAnchor: the point on widget to align with menu's anchor point

-> Gravity

menuAnchor: the point on menu to align with widget's anchor point

-> Maybe c

triggerEvent: the GdkEvent that initiated this request or Nothing if it's the current event

-> m () 

Displays menu and makes it available for selection.

See gtk_menu_popup_at_pointer () to pop up a menu at the master pointer. gtk_menu_popup_at_rect () also allows you to position a menu at an arbitrary rectangle.

menu will be positioned at widget, aligning their anchor points. widgetAnchor and menuAnchor determine anchor points on widget and menu to pin together. menu can optionally be offset by Menu:rect-anchor-dx and Menu:rect-anchor-dy.

Anchors should be specified under the assumption that the text direction is left-to-right; they will be flipped horizontally automatically if the text direction is right-to-left.

Other properties that influence the behaviour of this function are Menu:anchor-hints and Menu:menu-type-hint. Connect to the poppedUp signal to find out how it was actually positioned.

reorderChild

menuReorderChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsWidget b) 
=> a

menu: a Menu

-> b

child: the MenuItem to move

-> Int32

position: the new position to place child. Positions are numbered from 0 to n - 1

-> m () 

Moves child to a new position in the list of menu children.

reposition

menuReposition Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m () 

Repositions the menu according to its position function.

setAccelGroup

menuSetAccelGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsAccelGroup b) 
=> a

menu: a Menu

-> Maybe b

accelGroup: the AccelGroup to be associated with the menu.

-> m () 

Set the AccelGroup which holds global accelerators for the menu. This accelerator group needs to also be added to all windows that this menu is being used in with windowAddAccelGroup, in order for those windows to support all the accelerators contained in this group.

setAccelPath

menuSetAccelPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a valid Menu

-> Maybe Text

accelPath: a valid accelerator path, or Nothing to unset the path

-> m () 

Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The main purpose of this function is to spare the programmer the inconvenience of having to call menuItemSetAccelPath on each menu item that should support runtime user changable accelerators. Instead, by just calling menuSetAccelPath on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned.

For example, a menu containing menu items “New” and “Exit”, will, after gtk_menu_set_accel_path (menu, "<Gnumeric-Sheet>/File"); has been called, assign its items the accel paths: "<Gnumeric-Sheet>/File/New" and "<Gnumeric-Sheet>/File/Exit".

Assigning accel paths to menu items then enables the user to change their accelerators at runtime. More details about accelerator paths and their default setups can be found at accelMapAddEntry.

Note that accelPath string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with internStaticString.

setActive

menuSetActive Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Word32

index: the index of the menu item to select. Index values are from 0 to n-1

-> m () 

Selects the specified menu item within the menu. This is used by the ComboBox and should not be used by anyone else.

setMonitor

menuSetMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Int32

monitorNum: the number of the monitor on which the menu should be popped up

-> m () 

Informs GTK+ on which monitor a menu should be popped up. See monitorGetGeometry.

This function should be called from a GtkMenuPositionFunc if the menu should not appear on the same monitor as the pointer. This information can’t be reliably inferred from the coordinates returned by a GtkMenuPositionFunc, since, for very long menus, these coordinates may extend beyond the monitor boundaries or even the screen boundaries.

setReserveToggleSize

menuSetReserveToggleSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Bool

reserveToggleSize: whether to reserve size for toggles

-> m () 

Sets whether the menu should reserve space for drawing toggles or icons, regardless of their actual presence.

Properties

accelGroup

The accel group holding accelerators for the menu.

clearMenuAccelGroup :: (MonadIO m, IsMenu o) => o -> m () Source #

Set the value of the “accel-group” property to Nothing. When overloading is enabled, this is equivalent to

clear #accelGroup

constructMenuAccelGroup :: (IsMenu o, IsAccelGroup a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “accel-group” property. This is rarely needed directly, but it is used by new.

getMenuAccelGroup :: (MonadIO m, IsMenu o) => o -> m AccelGroup Source #

Get the value of the “accel-group” property. When overloading is enabled, this is equivalent to

get menu #accelGroup

setMenuAccelGroup :: (MonadIO m, IsMenu o, IsAccelGroup a) => o -> a -> m () Source #

Set the value of the “accel-group” property. When overloading is enabled, this is equivalent to

set menu [ #accelGroup := value ]

accelPath

An accel path used to conveniently construct accel paths of child items.

clearMenuAccelPath :: (MonadIO m, IsMenu o) => o -> m () Source #

Set the value of the “accel-path” property to Nothing. When overloading is enabled, this is equivalent to

clear #accelPath

constructMenuAccelPath :: IsMenu o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “accel-path” property. This is rarely needed directly, but it is used by new.

getMenuAccelPath :: (MonadIO m, IsMenu o) => o -> m Text Source #

Get the value of the “accel-path” property. When overloading is enabled, this is equivalent to

get menu #accelPath

setMenuAccelPath :: (MonadIO m, IsMenu o) => o -> Text -> m () Source #

Set the value of the “accel-path” property. When overloading is enabled, this is equivalent to

set menu [ #accelPath := value ]

active

The index of the currently selected menu item, or -1 if no menu item is selected.

constructMenuActive :: IsMenu o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “active” property. This is rarely needed directly, but it is used by new.

getMenuActive :: (MonadIO m, IsMenu o) => o -> m Int32 Source #

Get the value of the “active” property. When overloading is enabled, this is equivalent to

get menu #active

setMenuActive :: (MonadIO m, IsMenu o) => o -> Int32 -> m () Source #

Set the value of the “active” property. When overloading is enabled, this is equivalent to

set menu [ #active := value ]

anchorHints

Positioning hints for aligning the menu relative to a rectangle.

These hints determine how the menu should be positioned in the case that the menu would fall off-screen if placed in its ideal position.

For example, AnchorHintsFlipY will replace GravityNorthWest with GravitySouthWest and vice versa if the menu extends beyond the bottom edge of the monitor.

See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), gtk_menu_popup_at_pointer (), Menu:rect-anchor-dx, Menu:rect-anchor-dy, Menu:menu-type-hint, and poppedUp.

constructMenuAnchorHints :: IsMenu o => [AnchorHints] -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “anchor-hints” property. This is rarely needed directly, but it is used by new.

getMenuAnchorHints :: (MonadIO m, IsMenu o) => o -> m [AnchorHints] Source #

Get the value of the “anchor-hints” property. When overloading is enabled, this is equivalent to

get menu #anchorHints

setMenuAnchorHints :: (MonadIO m, IsMenu o) => o -> [AnchorHints] -> m () Source #

Set the value of the “anchor-hints” property. When overloading is enabled, this is equivalent to

set menu [ #anchorHints := value ]

attachWidget

The widget the menu is attached to. Setting this property attaches the menu without a MenuDetachFunc. If you need to use a detacher, use menuAttachToWidget directly.

clearMenuAttachWidget :: (MonadIO m, IsMenu o) => o -> m () Source #

Set the value of the “attach-widget” property to Nothing. When overloading is enabled, this is equivalent to

clear #attachWidget

constructMenuAttachWidget :: (IsMenu o, IsWidget a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “attach-widget” property. This is rarely needed directly, but it is used by new.

getMenuAttachWidget :: (MonadIO m, IsMenu o) => o -> m Widget Source #

Get the value of the “attach-widget” property. When overloading is enabled, this is equivalent to

get menu #attachWidget

setMenuAttachWidget :: (MonadIO m, IsMenu o, IsWidget a) => o -> a -> m () Source #

Set the value of the “attach-widget” property. When overloading is enabled, this is equivalent to

set menu [ #attachWidget := value ]

menuTypeHint

The SurfaceTypeHint to use for the menu's Surface.

See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), gtk_menu_popup_at_pointer (), Menu:anchor-hints, Menu:rect-anchor-dx, Menu:rect-anchor-dy, and poppedUp.

constructMenuMenuTypeHint :: IsMenu o => SurfaceTypeHint -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “menu-type-hint” property. This is rarely needed directly, but it is used by new.

getMenuMenuTypeHint :: (MonadIO m, IsMenu o) => o -> m SurfaceTypeHint Source #

Get the value of the “menu-type-hint” property. When overloading is enabled, this is equivalent to

get menu #menuTypeHint

setMenuMenuTypeHint :: (MonadIO m, IsMenu o) => o -> SurfaceTypeHint -> m () Source #

Set the value of the “menu-type-hint” property. When overloading is enabled, this is equivalent to

set menu [ #menuTypeHint := value ]

monitor

The monitor the menu will be popped up on.

constructMenuMonitor :: IsMenu o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “monitor” property. This is rarely needed directly, but it is used by new.

getMenuMonitor :: (MonadIO m, IsMenu o) => o -> m Int32 Source #

Get the value of the “monitor” property. When overloading is enabled, this is equivalent to

get menu #monitor

setMenuMonitor :: (MonadIO m, IsMenu o) => o -> Int32 -> m () Source #

Set the value of the “monitor” property. When overloading is enabled, this is equivalent to

set menu [ #monitor := value ]

rectAnchorDx

Horizontal offset to apply to the menu, i.e. the rectangle or widget anchor.

See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), gtk_menu_popup_at_pointer (), Menu:anchor-hints, Menu:rect-anchor-dy, Menu:menu-type-hint, and poppedUp.

constructMenuRectAnchorDx :: IsMenu o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “rect-anchor-dx” property. This is rarely needed directly, but it is used by new.

getMenuRectAnchorDx :: (MonadIO m, IsMenu o) => o -> m Int32 Source #

Get the value of the “rect-anchor-dx” property. When overloading is enabled, this is equivalent to

get menu #rectAnchorDx

setMenuRectAnchorDx :: (MonadIO m, IsMenu o) => o -> Int32 -> m () Source #

Set the value of the “rect-anchor-dx” property. When overloading is enabled, this is equivalent to

set menu [ #rectAnchorDx := value ]

rectAnchorDy

Vertical offset to apply to the menu, i.e. the rectangle or widget anchor.

See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), gtk_menu_popup_at_pointer (), Menu:anchor-hints, Menu:rect-anchor-dx, Menu:menu-type-hint, and poppedUp.

constructMenuRectAnchorDy :: IsMenu o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “rect-anchor-dy” property. This is rarely needed directly, but it is used by new.

getMenuRectAnchorDy :: (MonadIO m, IsMenu o) => o -> m Int32 Source #

Get the value of the “rect-anchor-dy” property. When overloading is enabled, this is equivalent to

get menu #rectAnchorDy

setMenuRectAnchorDy :: (MonadIO m, IsMenu o) => o -> Int32 -> m () Source #

Set the value of the “rect-anchor-dy” property. When overloading is enabled, this is equivalent to

set menu [ #rectAnchorDy := value ]

reserveToggleSize

A boolean that indicates whether the menu reserves space for toggles and icons, regardless of their actual presence.

This property should only be changed from its default value for special-purposes such as tabular menus. Regular menus that are connected to a menu bar or context menus should reserve toggle space for consistency.

constructMenuReserveToggleSize :: IsMenu o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “reserve-toggle-size” property. This is rarely needed directly, but it is used by new.

getMenuReserveToggleSize :: (MonadIO m, IsMenu o) => o -> m Bool Source #

Get the value of the “reserve-toggle-size” property. When overloading is enabled, this is equivalent to

get menu #reserveToggleSize

setMenuReserveToggleSize :: (MonadIO m, IsMenu o) => o -> Bool -> m () Source #

Set the value of the “reserve-toggle-size” property. When overloading is enabled, this is equivalent to

set menu [ #reserveToggleSize := value ]

Signals

moveScroll

type C_MenuMoveScrollCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MenuMoveScrollCallback Source #

Arguments

 = ScrollType

scrollType: a ScrollType

-> IO () 

No description available in the introspection data.

afterMenuMoveScroll :: (IsMenu a, MonadIO m) => a -> MenuMoveScrollCallback -> m SignalHandlerId Source #

Connect a signal handler for the moveScroll signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after menu #moveScroll callback

onMenuMoveScroll :: (IsMenu a, MonadIO m) => a -> MenuMoveScrollCallback -> m SignalHandlerId Source #

Connect a signal handler for the moveScroll signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on menu #moveScroll callback

poppedUp

type C_MenuPoppedUpCallback = Ptr () -> Ptr () -> Ptr () -> CInt -> CInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MenuPoppedUpCallback Source #

Arguments

 = Ptr ()

flippedRect: the position of menu after any possible flipping or Nothing if the backend can't obtain it

-> Ptr ()

finalRect: the final position of menu or Nothing if the backend can't obtain it

-> Bool

flippedX: True if the anchors were flipped horizontally

-> Bool

flippedY: True if the anchors were flipped vertically

-> IO () 

Emitted when the position of menu is finalized after being popped up using gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), or gtk_menu_popup_at_pointer ().

menu might be flipped over the anchor rectangle in order to keep it on-screen, in which case flippedX and flippedY will be set to True accordingly.

flippedRect is the ideal position of menu after any possible flipping, but before any possible sliding. finalRect is flippedRect, but possibly translated in the case that flipping is still ineffective in keeping menu on-screen.

The blue menu is menu's ideal position, the green menu is flippedRect, and the red menu is finalRect.

See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), gtk_menu_popup_at_pointer (), Menu:anchor-hints, Menu:rect-anchor-dx, Menu:rect-anchor-dy, and Menu:menu-type-hint.

afterMenuPoppedUp :: (IsMenu a, MonadIO m) => a -> MenuPoppedUpCallback -> m SignalHandlerId Source #

Connect a signal handler for the poppedUp signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after menu #poppedUp callback

mk_MenuPoppedUpCallback :: C_MenuPoppedUpCallback -> IO (FunPtr C_MenuPoppedUpCallback) Source #

Generate a function pointer callable from C code, from a C_MenuPoppedUpCallback.

onMenuPoppedUp :: (IsMenu a, MonadIO m) => a -> MenuPoppedUpCallback -> m SignalHandlerId Source #

Connect a signal handler for the poppedUp signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on menu #poppedUp callback