1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --               Copyright (C) 2006-2007, AdaCore                    -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  A Gtk_Cell_Renderer_Combo can be used to render a combobox in a cell. 
  26. --  </description> 
  27. --  <c_version>2.8.17</c_version> 
  28. --  <group>Trees and Lists</group> 
  29.  
  30. with Glib.Properties; 
  31. with Gtk.Cell_Renderer_Text; 
  32.  
  33. package Gtk.Cell_Renderer_Combo is 
  34.  
  35.    type Gtk_Cell_Renderer_Combo_Record is 
  36.      new Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record with null record; 
  37.    type Gtk_Cell_Renderer_Combo is 
  38.      access all Gtk_Cell_Renderer_Combo_Record'Class; 
  39.  
  40.    procedure Gtk_New    (Render : out Gtk_Cell_Renderer_Combo); 
  41.    procedure Initialize (Render : access Gtk_Cell_Renderer_Combo_Record'Class); 
  42.    --  Creates or initializes a new renderer. 
  43.    --  Adjust how text is drawn using object properties. 
  44.    --  Properties can be set either directly on the renderer, or in combination 
  45.    --  with a Gtk_Tree_View_Column so that the property is bound to a value 
  46.    --  in the Gtk_Tree_Model. For example, you can bind the "text" property 
  47.    --  on the cell renderer to a string value in the model, thus rendering 
  48.    --  a different string in each row of the Gtk_Tree_View. 
  49.  
  50.    function Get_Type return GType; 
  51.    --  Returns the internal value associated with this renderer 
  52.  
  53.    ---------------- 
  54.    -- Properties -- 
  55.    ---------------- 
  56.  
  57.    --  <properties> 
  58.    --  The following properties are defined for this widget. See 
  59.    --  Glib.Properties for more information on properties. 
  60.    -- 
  61.    --  Name:  Has_Entry_Property 
  62.    --  Type:  Boolean 
  63.    --  Descr: If FALSE, don't allow to enter strings other than the chosen ones 
  64.    -- 
  65.    --  Name:  Model_Property 
  66.    --  Type:  Object 
  67.    --  Descr: The model containing the possible values for the combo box 
  68.    -- 
  69.    --  Name:  Text_Column_Property 
  70.    --  Type:  Int 
  71.    --  Descr: A column in the data source model to get the strings from 
  72.    -- 
  73.    --  </properties> 
  74.  
  75.    Has_Entry_Property   : constant Glib.Properties.Property_Boolean; 
  76.    Model_Property       : constant Glib.Properties.Property_Object; 
  77.    Text_Column_Property : constant Glib.Properties.Property_Int; 
  78.  
  79. private 
  80.    pragma Import (C, Get_Type, "gtk_cell_renderer_combo_get_type"); 
  81.  
  82.    Has_Entry_Property : constant Glib.Properties.Property_Boolean := 
  83.      Glib.Properties.Build ("has-entry"); 
  84.    Model_Property : constant Glib.Properties.Property_Object := 
  85.      Glib.Properties.Build ("model"); 
  86.    Text_Column_Property : constant Glib.Properties.Property_Int := 
  87.      Glib.Properties.Build ("text-column"); 
  88.  
  89. end Gtk.Cell_Renderer_Combo;