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-2007 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. --  A Gtk_Option_Menu is a widget that allows the user to choose from a list of 
  27. --  valid choices. The Gtk_Option_Menu displays the selected choice. When 
  28. --  activated, the Gtk_Option_Menu displays a popup Gtk_Menu which allows the 
  29. --  user to make a new choice. 
  30. --  </description> 
  31. --  <c_version>2.8.17</c_version> 
  32. --  <group>Obsolescent widgets</group> 
  33.  
  34. with Glib.Properties; 
  35. with Gtk.Button; 
  36. with Gtk.Menu; 
  37. with Gtk.Widget; 
  38.  
  39. package Gtk.Option_Menu is 
  40.    pragma Obsolescent; 
  41.  
  42.    type Gtk_Option_Menu_Record is new Button.Gtk_Button_Record with private; 
  43.    type Gtk_Option_Menu is access all Gtk_Option_Menu_Record'Class; 
  44.  
  45.    procedure Gtk_New (Option_Menu : out Gtk_Option_Menu); 
  46.    --  Create a new Gtk_Option_Menu. 
  47.  
  48.    procedure Initialize (Option_Menu : access Gtk_Option_Menu_Record'Class); 
  49.    --  Internal initialization function. 
  50.    --  See the section "Creating your own widgets" in the documentation. 
  51.  
  52.    function Get_Type return Glib.GType; 
  53.    --  Return the internal value associated with a Gtk_Option_Menu. 
  54.  
  55.    procedure Set_Menu 
  56.      (Option_Menu : access Gtk_Option_Menu_Record; 
  57.       Menu        : access Widget.Gtk_Widget_Record'Class); 
  58.    function Get_Menu 
  59.      (Option_Menu : access Gtk_Option_Menu_Record) return Gtk.Menu.Gtk_Menu; 
  60.    --  Provide the Gtk_Menu that is popped up to allow the user to choose a new 
  61.    --  value. You should provide a simple menu avoiding the use of tearoff menu 
  62.    --  items, submenus, and accelerators. 
  63.  
  64.    procedure Remove_Menu 
  65.      (Option_Menu : access Gtk_Option_Menu_Record; 
  66.       Menu        : access Widget.Gtk_Widget_Record'Class); 
  67.    --  Remove the menu from the option menu. 
  68.  
  69.    procedure Set_History 
  70.      (Option_Menu : access Gtk_Option_Menu_Record; Index : Gint); 
  71.    function Get_History 
  72.      (Option_Menu : access Gtk_Option_Menu_Record) return Gint; 
  73.    --  Select the menu item specified by index making it the newly selected 
  74.    --  value for the option menu. 
  75.  
  76.    ---------------- 
  77.    -- Properties -- 
  78.    ---------------- 
  79.    --  The following properties are defined for this widget. See 
  80.    --  Glib.Properties for more information on properties. 
  81.  
  82.    --  <properties> 
  83.    --  Name:  Menu_Property 
  84.    --  Type:  Object 
  85.    --  Descr: The menu of options 
  86.    --  </properties> 
  87.  
  88.    Menu_Property : constant Glib.Properties.Property_Object; 
  89.  
  90.    ---------------------- 
  91.    -- Style Properties -- 
  92.    ---------------------- 
  93.    --  The following properties can be changed through the gtk theme and 
  94.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  95.  
  96.    --  <style_properties> 
  97.    --  Name:  Indicator_Size_Property 
  98.    --  Type:  Boxed 
  99.    --  Descr: Size of dropdown indicator 
  100.    -- 
  101.    --  Name:  Indicator_Spacing_Property 
  102.    --  Type:  Boxed 
  103.    --  Descr: Spacing around indicator 
  104.    --  </style_properties> 
  105.  
  106.    --  Indicator_Size_Property    : constant Glib.Properties.Property_Boxed; 
  107.    --  Indicator_Spacing_Property : constant Glib.Properties.Property_Boxed; 
  108.  
  109.    ------------- 
  110.    -- Signals -- 
  111.    ------------- 
  112.  
  113.    --  <signals> 
  114.    --  The following new signals are defined for this widget: 
  115.    -- 
  116.    --  - "changed" 
  117.    --    procedure Handler (Option : access Gtk_Option_Menu_Record'Class); 
  118.    --    Emitted when the selected value has changed 
  119.    -- 
  120.    --  </signals> 
  121.  
  122.    Signal_Changed : constant Glib.Signal_Name := "changed"; 
  123.  
  124. private 
  125.    type Gtk_Option_Menu_Record is new Button.Gtk_Button_Record 
  126.      with null record; 
  127.  
  128.    Menu_Property : constant Glib.Properties.Property_Object := 
  129.      Glib.Properties.Build ("menu"); 
  130.  
  131. --     Indicator_Size_Property : constant Glib.Properties.Property_Boxed := 
  132. --       Glib.Properties.Build ("indicator-size"); 
  133. --     Indicator_Spacing_Property : constant Glib.Properties.Property_Boxed := 
  134. --       Glib.Properties.Build ("indicator-spacing"); 
  135.  
  136.    pragma Import (C, Get_Type, "gtk_option_menu_get_type"); 
  137. end Gtk.Option_Menu;