1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2013, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  This widget implements a drop-down menu. 
  32. --  This is basically a simple box that contains a series of Gtk_Menu_Item 
  33. --  widgets, on which the user can click to perform actions. 
  34. -- 
  35. --  Such a menu is usually part of a Gtk_Menu_Bar (at the top of the window), 
  36. --  or activated by clicking on an item in another Gtk_Menu. 
  37. --  See Gtk.Option_Menu for another way of displaying menus. 
  38. -- 
  39. --  All the menus in GtkAda can be "Tear off" menus, i.e you can detach 
  40. --  them from their parent (either a menu bar or another menu) to keep them 
  41. --  visible on the screen at all times). 
  42. -- 
  43. --  It is worth noting that by default, the user of your application will be 
  44. --  able to dynamically modify the shortcuts associated with each menu item. 
  45. --  For instance, selecting a menu item and pressing a key will assign this 
  46. --  new shortcut to the item, possibly removing the shortcut from any other 
  47. --  item it was associated with. 
  48. -- 
  49. --  Note that pressing <backspace> will simply remove the shortcut. 
  50. -- 
  51. --  This default behavior, somewhat unexpected, can be canceled. 
  52. --  There are two ways to control this behavior: you can lock a specific menu 
  53. --  item by calling Gtk.Widget.Lock_Accelerators on it. But you can also 
  54. --  lock all the menu items at once by calling Gtk.Accel_Group.Lock for all 
  55. --  the accelerator groups that were used (the GUI builder gate generally 
  56. --  creates a single one), as well as on the group returned by 
  57. --  Gtk.Accel_Group.Get_Default, which is the one used for items that don't 
  58. --  initially have a shortcut. 
  59. --  </description> 
  60. --  <c_version>2.16.6</c_version> 
  61. --  <group>Menus and Toolbars</group> 
  62. --  <testgtk>create_menu.adb</testgtk> 
  63.  
  64. with Gdk.Screen; 
  65. with Glib.Properties; 
  66. with Gtk.Accel_Group; 
  67. with Gtk.Menu_Item; use Gtk.Menu_Item; 
  68. with Gtk.Menu_Shell; 
  69. with Gtk.Widget; 
  70.  
  71. package Gtk.Menu is 
  72.  
  73.    type Gtk_Menu_Record is new 
  74.      Gtk.Menu_Shell.Gtk_Menu_Shell_Record with private; 
  75.    type Gtk_Menu is access all Gtk_Menu_Record'Class; 
  76.  
  77.    type Gtk_Menu_Detach_Func is access procedure 
  78.      (Attach_Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  79.       Menu          : access Gtk_Menu_Record'Class); 
  80.    pragma Convention (C, Gtk_Menu_Detach_Func); 
  81.    --  Function called when a menu previously attached to a widget is detached. 
  82.    --  An access to this function is given in Attach_To_Widget. 
  83.  
  84.    --------------------- 
  85.    -- Creating a menu -- 
  86.    --------------------- 
  87.  
  88.    procedure Gtk_New (Widget : out Gtk_Menu); 
  89.    --  Create a new empty menu. 
  90.  
  91.    procedure Initialize (Widget : access Gtk_Menu_Record'Class); 
  92.    --  Internal initialization function. 
  93.    --  See the section "Creating your own widgets" in the documentation. 
  94.  
  95.    function Get_Type return Gtk.Gtk_Type; 
  96.    --  Return the internal value associated with a Gtk_Menu. 
  97.  
  98.    procedure Set_Active (Menu : access Gtk_Menu_Record; Index : Guint); 
  99.    function Get_Active 
  100.      (Menu : access Gtk_Menu_Record) return Gtk.Menu_Item.Gtk_Menu_Item; 
  101.    --  Select a specified item in the menu. 
  102.    --  You will almost never need this function, it is used internally by 
  103.    --  Gtk_Option_Menu, for which it is the item that is currently selected. 
  104.    --  Note that the item is not considered as being pressed by the user when 
  105.    --  you call Set_Active, and thus no callback is called as a result. 
  106.  
  107.    procedure Set_Tearoff_State 
  108.      (Menu : access Gtk_Menu_Record; Torn_Off : Boolean); 
  109.    function Get_Tearoff_State (Menu : access Gtk_Menu_Record) return Boolean; 
  110.    --  Modify the tearoff status of the menu. 
  111.    --  If Torn_Off is False, the menu is displayed as a drop down menu which 
  112.    --  disappears when the menu is not active. If Torn_Off is True, the menu 
  113.    --  persists until it is closed or reattached. 
  114.    --  Note that you can give the user access to this functionality by 
  115.    --  inserting a Gtk_Tearoff_Menu_Item in the menu. 
  116.  
  117.    procedure Set_Title (Menu : access Gtk_Menu_Record; Title : UTF8_String); 
  118.    function Get_Title  (Menu : access Gtk_Menu_Record) return UTF8_String; 
  119.    --  Set the title of the menu. 
  120.    --  Title is displayed when the menu is displayed as a tearoff menu in an 
  121.    --  independent window. 
  122.  
  123.    procedure Reorder_Child 
  124.      (Menu     : access Gtk_Menu_Record; 
  125.       Child    : access Gtk.Widget.Gtk_Widget_Record'Class; 
  126.       Position : Gint); 
  127.    --  Move an existing menu_item within the menu. 
  128.    --  Its new position is given by Position, 0 being the first item in the 
  129.    --  menu. 
  130.    --  If Child does not exist in the menu, nothing is done. 
  131.  
  132.    procedure Attach 
  133.      (Menu          : access Gtk_Menu_Record; 
  134.       Child         : access Gtk.Menu_Item.Gtk_Menu_Item_Record'Class; 
  135.       Left_Attach   : Guint; 
  136.       Right_Attach  : Guint; 
  137.       Top_Attach    : Guint; 
  138.       Bottom_Attach : Guint); 
  139.    --  Adds a new #GtkMenuItem to a (table) menu. The number of 'cells' that 
  140.    --  an item will occupy is specified by left_attach, right_attach, 
  141.    --  top_attach and bottom_attach. These each represent the leftmost, 
  142.    --  rightmost, uppermost and lower column and row numbers of the table. 
  143.    --  (Columns and rows are indexed from zero). 
  144.    -- 
  145.    --  Note that this function is not related to Detach(). 
  146.    -- 
  147.    --  Adding items to a standard menu is simply done by calling Add(). 
  148.  
  149.    ----------------------- 
  150.    -- Displaying a menu -- 
  151.    ----------------------- 
  152.  
  153.    type Gtk_Menu_Position_Func is access procedure 
  154.      (Menu : access Gtk_Menu_Record'Class; 
  155.       X    : out Gint; 
  156.       Y    : out Gint); 
  157.    --  This function is called when displaying a popup menu on the screen. 
  158.    --  It should return the (X, Y) coordinates of the menu. 
  159.    --  Note that you might want to attach the menu to a widget first if you 
  160.    --  want to display the menu relative to its attached widget. 
  161.    -- 
  162.    --  Note that there is a second version of this function (with added 
  163.    --  user data in the package User_Menu_Popup below 
  164.  
  165.    procedure Popup 
  166.      (Menu              : access Gtk_Menu_Record; 
  167.       Parent_Menu_Shell : Gtk.Menu_Shell.Gtk_Menu_Shell := null; 
  168.       Parent_Menu_Item  : Gtk.Menu_Item.Gtk_Menu_Item := null; 
  169.       Func              : Gtk_Menu_Position_Func := null; 
  170.       Button            : Guint := 1; 
  171.       Activate_Time     : Guint32 := 0); 
  172.    --  Display a menu on the screen. 
  173.    --  This is the function to use to create contextual menus. 
  174.    --  Most of the time, the parameters can have a null value. 
  175.    --  Parent_Menu_Shell is the Gtk_Menu_Shell that contains Parent_Menu_Item, 
  176.    --  i.e. the widget that triggered the display of the menu. 
  177.    --  Func is a function that returns the coordinates for the menu. If it is 
  178.    --  null, then a default function that positions the menu at the pointer 
  179.    --  location is used. 
  180.    --  Button is the mouse button that was pressed to initiate the event. 
  181.    --  Activate_Time is the time at which the event occurred (you can get it 
  182.    --  directly from the Gdk_Event structure). 
  183.    -- 
  184.    --  Note that a variant of this function is given in the generic package 
  185.    --  User_Menu_Popup. 
  186.  
  187.    --  Note: in the Popup function, the Parent_* parameters are not access 
  188.    --  parameters because they might be null. 
  189.  
  190.    type C_Gtk_Menu_Position_Func is access procedure 
  191.      (Menu      : System.Address; 
  192.       X         : out Gint; 
  193.       Y         : out Gint; 
  194.       Push_In   : out Gboolean; 
  195.       User_Data : System.Address); 
  196.    pragma Convention (C, C_Gtk_Menu_Position_Func); 
  197.  
  198.    procedure Popup 
  199.      (Menu              : access Gtk_Menu_Record; 
  200.       Parent_Menu_Shell : Gtk.Menu_Shell.Gtk_Menu_Shell := null; 
  201.       Parent_Menu_Item  : Gtk.Menu_Item.Gtk_Menu_Item := null; 
  202.       Func              : C_Gtk_Menu_Position_Func := null; 
  203.       User_Data         : System.Address; 
  204.       Button            : Guint := 1; 
  205.       Activate_Time     : Guint32 := 0); 
  206.    --  Similar to the Popup function above, but exposes a lower level 
  207.    --  interface to a C positioning function (C_Gtk_Menu_Position_Func). 
  208.  
  209.    generic 
  210.       --  <doc_ignore> 
  211.       type Data_Type is private; 
  212.       --  </doc_ignore> 
  213.  
  214.    package User_Menu_Popup is 
  215.       --  <doc_ignore> 
  216.       type Gtk_Menu_Position_Func is access procedure 
  217.         (Menu      : access Gtk_Menu_Record'Class; 
  218.          X         : out Gint; 
  219.          Y         : out Gint; 
  220.          User_Data : access Data_Type); 
  221.       --  </doc_ignore> 
  222.  
  223.       procedure Popup 
  224.         (Menu              : access Gtk_Menu_Record'Class; 
  225.          Data              : access Data_Type; 
  226.          Parent_Menu_Shell : Gtk.Menu_Shell.Gtk_Menu_Shell := null; 
  227.          Parent_Menu_Item  : Gtk.Menu_Item.Gtk_Menu_Item := null; 
  228.          Func              : Gtk_Menu_Position_Func := null; 
  229.          Button            : Guint := 1; 
  230.          Activate_Time     : Guint32 := 0); 
  231.       --  Same as the Popup function above. 
  232.       --  Note that Data is not duplicated, thus you should take care of the 
  233.       --  memory allocation/deallocation yourself. 
  234.  
  235.       --  Note also that the order of parameters is slightly different from the 
  236.       --  C version. 
  237.    private 
  238.       procedure Internal_Menu_Position_Func_With_Data 
  239.         (Menu      : System.Address; 
  240.          X         : out Gint; 
  241.          Y         : out Gint; 
  242.          Push_In   : out Gboolean; 
  243.          User_Data : System.Address); 
  244.       pragma Convention (C, Internal_Menu_Position_Func_With_Data); 
  245.       --  Wrapper function passed to C.  This spec has been put in the 
  246.       --  generic's private part because we can not use 'Access in the 
  247.       --  generic body to assign to a C_Gtk_Menu_Position_Func type, because 
  248.       --  the type is declared outside the generic unit.  (RM 3.10.2(32)) 
  249.  
  250.       Internal_Menu_Position_Func_With_Data_Access : 
  251.         constant C_Gtk_Menu_Position_Func := 
  252.         Internal_Menu_Position_Func_With_Data'Access; 
  253.    end User_Menu_Popup; 
  254.  
  255.    procedure Popdown (Menu : access Gtk_Menu_Record); 
  256.    --  Remove the menu from the screen 
  257.  
  258.    procedure Reposition (Menu : access Gtk_Menu_Record); 
  259.    --  Reposition a menu according to its position function. 
  260.    --  This function is set when Popup is called. 
  261.  
  262.    procedure Set_Monitor 
  263.      (Menu        : access Gtk_Menu_Record; 
  264.       Monitor_Num : Gint); 
  265.    --  Informs GTK+ on which monitor a menu should be popped up. 
  266.    --  See Gdk.Screen.Get_Monitor_Geometry. 
  267.    -- 
  268.    --  This function should be called from a Gtk_Menu_Position_Func if the 
  269.    --  menu should not appear on the same monitor as the pointer. This 
  270.    --  information can't be reliably inferred from the coordinates returned 
  271.    --  by a Gtk_Menu_Position_Func, since, for very long menus, these 
  272.    --  coordinates may extend beyond the monitor boundaries or even the screen 
  273.    --  boundaries. 
  274.  
  275.    function Get_Monitor (Menu : access Gtk_Menu_Record) return Gint; 
  276.    --  Retrieves the number of the monitor on which to show the menu, or 
  277.    --  -1 if no monitor has been set. 
  278.  
  279.    procedure Set_Screen 
  280.      (Menu   : access Gtk_Menu_Record; 
  281.       Screen : access Gdk.Screen.Gdk_Screen_Record'Class); 
  282.    --  Sets the Gdk_Screen on which the menu will be displayed. 
  283.  
  284.    -------------------------------- 
  285.    -- Modifying the accelerators -- 
  286.    -------------------------------- 
  287.  
  288.    procedure Set_Accel_Group 
  289.      (Menu  : access Gtk_Menu_Record; 
  290.       Accel : Accel_Group.Gtk_Accel_Group); 
  291.    function Get_Accel_Group 
  292.      (Menu : access Gtk_Menu_Record) return Accel_Group.Gtk_Accel_Group; 
  293.    --  Set the Accel_Group that holds the global accelerators and key bindings 
  294.    --  for the menu. 
  295.  
  296.    procedure Set_Accel_Path 
  297.      (Menu       : access Gtk_Menu_Record; 
  298.       Accel_Path : UTF8_String); 
  299.    function Get_Accel_Path (Menu : access Gtk_Menu_Record) return String; 
  300.    --  Set an accelerator path for this menu from which accelerator paths 
  301.    --  for its immediate children, its menu items, can be constructed. 
  302.    --  The main purpose of this function is to spare the programmer the 
  303.    --  inconvenience of having to call Gtk.Menu_Item.Set_Accel_Path on 
  304.    --  each menu item that should support runtime user changable accelerators. 
  305.    --  Instead, by just calling Gtk.Menu.Set_Accel_Path on their parent, 
  306.    --  each menu item of this menu, that contains a label describing its 
  307.    --  purpose, automatically gets an accel path assigned. For example, a menu 
  308.    --  containing menu items "New" and "Exit", will, after 
  309.    --  Set_Accel_Path (menu, "<Gnumeric-Sheet>/File"); has been called, assign 
  310.    --  its items the accel paths: 
  311.    --  "<Gnumeric-Sheet>/File/New" and "<Gnumeric-Sheet>/File/Exit". 
  312.    --  Assigning accel paths to menu items then enables the user to change 
  313.    --  their accelerators at runtime. 
  314.  
  315.    ---------------------------------- 
  316.    -- Attaching a menu to a widget -- 
  317.    ---------------------------------- 
  318.  
  319.    procedure Attach_To_Widget 
  320.      (Menu          : access Gtk_Menu_Record; 
  321.       Attach_Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  322.       Detacher      : Gtk_Menu_Detach_Func); 
  323.    --  Attach a menu to the widget. 
  324.    --  When the menu is detached from the widget (for instance when it is 
  325.    --  destroyed), the procedure Detacher will be called. 
  326.    --  You will almost never need to use this function, unless you specifically 
  327.    --  want a call back when a widget becomes unavailable. 
  328.    --  If Attach_Widget is a menu_item with a single label in it, the name of 
  329.    --  the window created when Menu is teared-off will be the label in the 
  330.    --  menu_item. 
  331.  
  332.    procedure Detach (Menu : access Gtk_Menu_Record); 
  333.    --  Detach the menu from its widget, and call the Detacher set in 
  334.    --  Attach_To_Widget. 
  335.  
  336.    function Get_Attach_Widget 
  337.      (Menu : access Gtk_Menu_Record) return Gtk.Widget.Gtk_Widget; 
  338.    --  Return the widget to which the menu was attached. 
  339.    --  If the menu was not attached, this function returns null. 
  340.  
  341.    function Get_For_Attach_Widget 
  342.      (Widget : access Gtk.Widget.Gtk_Widget_Record'Class) 
  343.       return Gtk.Widget.Widget_List.Glist; 
  344.    --  Returns a list of the menus which are attached to this widget. 
  345.    --  This list is owned by GTK+ and must not be modified. 
  346.  
  347.    ---------------- 
  348.    -- Properties -- 
  349.    ---------------- 
  350.    --  The following properties are defined for this widget. See 
  351.    --  Glib.Properties for more information on properties. 
  352.  
  353.    --  <properties> 
  354.    --  Name:  Accel_Group_Property 
  355.    --  Type:  Object 
  356.    --  Descr: The accel group holding accelerators for the menu 
  357.    -- 
  358.    --  Name:  Accel_Path_Property 
  359.    --  Type:  String 
  360.    --  Descr: An accel path used to conveniently construct accel paths of 
  361.    --         child items 
  362.    -- 
  363.    --  Name:  Active_Property 
  364.    --  Type:  Int 
  365.    --  Descr: The currently selected menu item 
  366.    -- 
  367.    --  Name:  Attach_Widget_Property 
  368.    --  Type:  Object 
  369.    --  Descr: The widget the menu is attached to 
  370.    -- 
  371.    --  Name:  Monitor_Property 
  372.    --  Type:  Int 
  373.    --  Descr: The monitor the menu will be popped up on 
  374.    -- 
  375.    --  Name:  Tearoff_State_Property 
  376.    --  Type:  Boolean 
  377.    --  Descr: A boolean that indicates whether the menu is torn-off 
  378.    -- 
  379.    --  Name:  Tearoff_Title_Property 
  380.    --  Type:  String 
  381.    --  Descr: A title that may be displayed by the window manager when this 
  382.    --         menu is torn-off 
  383.    --  </properties> 
  384.  
  385.    Accel_Group_Property   : constant Glib.Properties.Property_Object; 
  386.    Accel_Path_Property    : constant Glib.Properties.Property_String; 
  387.    Active_Property        : constant Glib.Properties.Property_Int; 
  388.    Attach_Widget_Property : constant Glib.Properties.Property_Object; 
  389.    Monitor_Property       : constant Glib.Properties.Property_Int; 
  390.    Tearoff_State_Property : constant Glib.Properties.Property_Boolean; 
  391.    Tearoff_Title_Property : constant Glib.Properties.Property_String; 
  392.  
  393.    ---------------------- 
  394.    -- Child Properties -- 
  395.    ---------------------- 
  396.    --  The following properties can be set on children of this widget. See 
  397.    --  in particular Gtk.Containers.Child_Set_Property. 
  398.  
  399.    --  <child_properties> 
  400.    --  Name:  Bottom_Attach_Property 
  401.    --  Type:  Int 
  402.    --  Descr: The row number to attach the bottom of the child to 
  403.    -- 
  404.    --  Name:  Left_Attach_Property 
  405.    --  Type:  Int 
  406.    --  Descr: The column number to attach the left side of the child to 
  407.    -- 
  408.    --  Name:  Right_Attach_Property 
  409.    --  Type:  Int 
  410.    --  Descr: The column number to attach the right side of the child to 
  411.    -- 
  412.    --  Name:  Top_Attach_Property 
  413.    --  Type:  Int 
  414.    --  Descr: The row number to attach the top of the child to 
  415.    --  </child_properties> 
  416.  
  417.    Bottom_Attach_Property : constant Glib.Properties.Property_Int; 
  418.    Left_Attach_Property   : constant Glib.Properties.Property_Int; 
  419.    Right_Attach_Property  : constant Glib.Properties.Property_Int; 
  420.    Top_Attach_Property    : constant Glib.Properties.Property_Int; 
  421.  
  422.    ---------------------- 
  423.    -- Style Properties -- 
  424.    ---------------------- 
  425.    --  The following properties can be changed through the gtk theme and 
  426.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  427.  
  428.    --  <style_properties> 
  429.    --  Name:  Arrow_Placement_Property 
  430.    --  Type:  Enum 
  431.    --  Descr: Indicates where scroll arrows should be placed 
  432.    -- 
  433.    --  Name:  Arrow_Scaling_Property 
  434.    --  Type:  Float 
  435.    --  Descr: Arbitrary constant to scale down the size of the scroll arrow 
  436.    -- 
  437.    --  Name:  Double_Arrows_Property 
  438.    --  Type:  Boolean 
  439.    --  Descr: When scrolling, always show both arrows. 
  440.    -- 
  441.    --  Name:  Horizontal_Offset_Property 
  442.    --  Type:  Int 
  443.    --  Descr: When the menu is a submenu, position it this number of pixels 
  444.    --         offset horizontally 
  445.    -- 
  446.    --  Name:  Horizontal_Padding_Property 
  447.    --  Type:  Int 
  448.    --  Descr: Extra space at the left and right edges of the menu 
  449.    -- 
  450.    --  Name:  Vertical_Offset_Property 
  451.    --  Type:  Int 
  452.    --  Descr: When the menu is a submenu, position it this number of pixels 
  453.    --         offset vertically 
  454.    -- 
  455.    --  Name:  Vertical_Padding_Property 
  456.    --  Type:  Int 
  457.    --  Descr: Extra space at the top and bottom of the menu 
  458.    --  </style_properties> 
  459.  
  460.    Arrow_Placement_Property    : constant Glib.Properties.Property_Enum; 
  461.    Arrow_Scaling_Property      : constant Glib.Properties.Property_Float; 
  462.    Double_Arrows_Property      : constant Glib.Properties.Property_Boolean; 
  463.    Horizontal_Offset_Property  : constant Glib.Properties.Property_Int; 
  464.    Horizontal_Padding_Property : constant Glib.Properties.Property_Int; 
  465.    Vertical_Offset_Property    : constant Glib.Properties.Property_Int; 
  466.    Vertical_Padding_Property   : constant Glib.Properties.Property_Int; 
  467.  
  468.    ------------- 
  469.    -- Signals -- 
  470.    ------------- 
  471.  
  472.    --  <signals> 
  473.    --  The following new signals are defined for this widget: 
  474.    -- 
  475.    --  - "move_scroll" 
  476.    --    procedure Handler 
  477.    --       (Menu : access Gtk_Menu_Record'Class; 
  478.    --        Typ  : Gtk_Scroll_Type); 
  479.    --    Requests that another part of the menu be made visible. Menus that 
  480.    --    display lots of items might not fit on the screen. When this is the 
  481.    --    case, gtk+ will insert some scrolling arrows on both ends of the menus 
  482.    --    and emitting this signal will behave as if the user had clicked on one 
  483.    --    of these arrows. 
  484.    --    This signal is mostly useful as a keybinding 
  485.    -- 
  486.    --  </signals> 
  487.  
  488.    Signal_Move_Scroll : constant Glib.Signal_Name := "move_scroll"; 
  489.  
  490. private 
  491.    type Gtk_Menu_Record is new Gtk.Menu_Shell.Gtk_Menu_Shell_Record 
  492.      with null record; 
  493.  
  494.    Accel_Group_Property : constant Glib.Properties.Property_Object := 
  495.      Glib.Properties.Build ("accel-group"); 
  496.    Accel_Path_Property : constant Glib.Properties.Property_String := 
  497.      Glib.Properties.Build ("accel-path"); 
  498.    Active_Property : constant Glib.Properties.Property_Int := 
  499.      Glib.Properties.Build ("active"); 
  500.    Attach_Widget_Property : constant Glib.Properties.Property_Object := 
  501.      Glib.Properties.Build ("attach-widget"); 
  502.    Monitor_Property : constant Glib.Properties.Property_Int := 
  503.      Glib.Properties.Build ("monitor"); 
  504.    Tearoff_State_Property : constant Glib.Properties.Property_Boolean := 
  505.      Glib.Properties.Build ("tearoff-state"); 
  506.    Tearoff_Title_Property : constant Glib.Properties.Property_String := 
  507.      Glib.Properties.Build ("tearoff-title"); 
  508.  
  509.    Bottom_Attach_Property : constant Glib.Properties.Property_Int := 
  510.      Glib.Properties.Build ("bottom-attach"); 
  511.    Left_Attach_Property : constant Glib.Properties.Property_Int := 
  512.      Glib.Properties.Build ("left-attach"); 
  513.    Right_Attach_Property : constant Glib.Properties.Property_Int := 
  514.      Glib.Properties.Build ("right-attach"); 
  515.    Top_Attach_Property : constant Glib.Properties.Property_Int := 
  516.      Glib.Properties.Build ("top-attach"); 
  517.  
  518.    Arrow_Placement_Property : constant Glib.Properties.Property_Enum := 
  519.      Glib.Properties.Build ("arrow-placement"); 
  520.    Arrow_Scaling_Property : constant Glib.Properties.Property_Float := 
  521.      Glib.Properties.Build ("arrow-scaling"); 
  522.    Double_Arrows_Property : constant Glib.Properties.Property_Boolean := 
  523.      Glib.Properties.Build ("double-arrows"); 
  524.    Horizontal_Offset_Property : constant Glib.Properties.Property_Int := 
  525.      Glib.Properties.Build ("horizontal-offset"); 
  526.    Horizontal_Padding_Property : constant Glib.Properties.Property_Int := 
  527.      Glib.Properties.Build ("horizontal-padding"); 
  528.    Vertical_Offset_Property : constant Glib.Properties.Property_Int := 
  529.      Glib.Properties.Build ("vertical-offset"); 
  530.    Vertical_Padding_Property : constant Glib.Properties.Property_Int := 
  531.      Glib.Properties.Build ("vertical-padding"); 
  532.  
  533.    pragma Import (C, Get_Type, "gtk_menu_get_type"); 
  534. end Gtk.Menu; 
  535.  
  536. --  <example> 
  537. --  <include>../examples/documentation/contextual.adb</include> 
  538. --  </example>