Index

Package: Popup_For_Device_User_Data (generic)

Description

generic
      type User_Data_Type (<>) is private;
      with procedure Destroy (Data : in out User_Data_Type) is null;
   package Popup_For_Device_User_Data is

Types

User_Data_Type

type User_Data_Type (<>) is private;

Gtk_Menu_Position_Func

type Gtk_Menu_Position_Func is access procedure
        (Menu      : not null access Gtk.Menu.Gtk_Menu_Record'Class;
         X         : out Gint;
         Y         : out Gint;
         Push_In   : out Boolean;
         User_Data : User_Data_Type);
A user function supplied when calling Gtk.Menu.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, gtk_menu_set_monitor must be called. "menu": a Gtk.Menu.Gtk_Menu. "x": address of the Gint representing the horizontal position where the menu shall be drawn. "y": address of the Gint 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 Gtk.Menu.Popup Data parameter.

Subprograms & Entries

Destroy

procedure Destroy 
(Data: in out User_Data_Type) is null;

Popup_For_Device

procedure Popup_For_Device 
(Menu: not null access Gtk.Menu.Gtk_Menu_Record'Class;
Device: access Gdk.Device.Gdk_Device_Record'Class;
Parent_Menu_Shell: access Gtk.Widget.Gtk_Widget_Record'Class;
Parent_Menu_Item: access Gtk.Widget.Gtk_Widget_Record'Class;
Func: Gtk_Menu_Position_Func;
Data: User_Data_Type;
Button: Guint;
Activate_Time: Guint32);
Displays a menu and makes it available for selection. Applications can use this function to display context-sensitive menus, and will typically supply null for the Parent_Menu_Shell, Parent_Menu_Item, Func, Data and Destroy parameters. The default menu positioning function will position the menu at the current position of Device (or its corresponding pointer). The Button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, Button should be 0. The Activate_Time parameter is used to conflict-resolve initiation of concurrent requests for mouse/keyboard grab requests. To function properly, this needs to be the time stamp of the user event (such as a mouse click or key press) that caused the initiation of the popup. Only if no such event is available, Gtk.Main.Get_Current_Event_Time can be used instead. Since: gtk+ 3.0 "device": a Gdk.Device.Gdk_Device "parent_menu_shell": the menu shell containing the triggering menu item, or null "parent_menu_item": the menu item whose activation triggered the popup, or null "func": a user supplied function used to position the menu, or null "data": user supplied data to be passed to Func "button": the mouse button which was pressed to initiate the event "activate_time": the time at which the activation event occurred