1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --               Copyright (C) 2006-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  A Gtk_Cell_Renderer_Combo can be used to render a combobox in a cell. 
  31. --  </description> 
  32. --  <c_version>2.8.17</c_version> 
  33. --  <group>Trees and Lists</group> 
  34.  
  35. with Glib.Properties; 
  36. with Gtk.Cell_Renderer_Text; 
  37.  
  38. package Gtk.Cell_Renderer_Combo is 
  39.  
  40.    type Gtk_Cell_Renderer_Combo_Record is 
  41.      new Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record with null record; 
  42.    type Gtk_Cell_Renderer_Combo is 
  43.      access all Gtk_Cell_Renderer_Combo_Record'Class; 
  44.  
  45.    procedure Gtk_New    (Render : out Gtk_Cell_Renderer_Combo); 
  46.    procedure Initialize (Render : access Gtk_Cell_Renderer_Combo_Record'Class); 
  47.    --  Creates or initializes a new renderer. 
  48.    --  Adjust how text is drawn using object properties. 
  49.    --  Properties can be set either directly on the renderer, or in combination 
  50.    --  with a Gtk_Tree_View_Column so that the property is bound to a value 
  51.    --  in the Gtk_Tree_Model. For example, you can bind the "text" property 
  52.    --  on the cell renderer to a string value in the model, thus rendering 
  53.    --  a different string in each row of the Gtk_Tree_View. 
  54.  
  55.    function Get_Type return GType; 
  56.    --  Returns the internal value associated with this renderer 
  57.  
  58.    ---------------- 
  59.    -- Properties -- 
  60.    ---------------- 
  61.  
  62.    --  <properties> 
  63.    --  The following properties are defined for this widget. See 
  64.    --  Glib.Properties for more information on properties. 
  65.    -- 
  66.    --  Name:  Has_Entry_Property 
  67.    --  Type:  Boolean 
  68.    --  Descr: If FALSE, don't allow to enter strings other than the chosen ones 
  69.    -- 
  70.    --  Name:  Model_Property 
  71.    --  Type:  Object 
  72.    --  Descr: The model containing the possible values for the combo box 
  73.    -- 
  74.    --  Name:  Text_Column_Property 
  75.    --  Type:  Int 
  76.    --  Descr: A column in the data source model to get the strings from 
  77.    -- 
  78.    --  </properties> 
  79.  
  80.    Has_Entry_Property   : constant Glib.Properties.Property_Boolean; 
  81.    Model_Property       : constant Glib.Properties.Property_Object; 
  82.    Text_Column_Property : constant Glib.Properties.Property_Int; 
  83.  
  84. private 
  85.    pragma Import (C, Get_Type, "gtk_cell_renderer_combo_get_type"); 
  86.  
  87.    Has_Entry_Property : constant Glib.Properties.Property_Boolean := 
  88.      Glib.Properties.Build ("has-entry"); 
  89.    Model_Property : constant Glib.Properties.Property_Object := 
  90.      Glib.Properties.Build ("model"); 
  91.    Text_Column_Property : constant Glib.Properties.Property_Int := 
  92.      Glib.Properties.Build ("text-column"); 
  93.  
  94. end Gtk.Cell_Renderer_Combo;