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