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