1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                 Copyright (C) 2001-2010, 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. --  General organization of the tree_view widgets: 
  31. -- 
  32. --  <example> 
  33. --    ______________Tree_View___________________________________ 
  34. --   |   _________________________     ________________________| 
  35. --   |  |_____Tree_View_Column1__|    |___Tree_View_Column2 __|| 
  36. --   |  |                        |    |                       || 
  37. --   |  |  ----------- ---------||    |                       || 
  38. --   |  |  |Renderer1| |render2 ||    |                       || 
  39. --   |  |  |         | |        ||    |                       || 
  40. --   |  |  |         | |        ||    |                       || 
  41. --   |  |  |         | |        ||    |                       || 
  42. --   |  |  |---------| |--------||    |                       || 
  43. --   |  |________________________|    |_______________________|| 
  44. --   |_________________________________________________________| 
  45. -- 
  46. --  </example> 
  47. --  A tree view can contain multiple physical columns on the screen. These 
  48. --  columns can have a button at the top, typically to force an ordering 
  49. --  of the tree). They can also be reorganized interactively by the user. 
  50. -- 
  51. --  Each physical column can display several information, like buttons, 
  52. --  strings, ... Each of this display comes from a cell_renderer, that displays 
  53. --  some data it reads from the model associated with the tree_view. 
  54. -- 
  55. --  The renderers are then divided into lines, which are typically pointed to 
  56. --  by iterators (Gtk_Tree_Iter). 
  57. --  </description> 
  58. --  <c_version>2.8.17</c_version> 
  59. --  <group>Trees and Lists</group> 
  60.  
  61. with Glib.Properties; 
  62. with Glib.Generic_Properties; 
  63. with Gdk.Rectangle; 
  64. with Gtk; 
  65. with Gtk.Cell_Renderer; 
  66. with Gtk.Enums; use Gtk.Enums; 
  67. with Gtk.Object; 
  68. with Gtk.Tree_Model; 
  69. with Gtk.Widget; 
  70.  
  71. with Glib.Glist; 
  72. pragma Elaborate_All (Glib.Glist); 
  73. with Ada.Unchecked_Conversion; 
  74.  
  75. package Gtk.Tree_View_Column is 
  76.  
  77.    type Gtk_Tree_View_Column_Record is 
  78.      new Gtk.Object.Gtk_Object_Record with private; 
  79.    type Gtk_Tree_View_Column is access all Gtk_Tree_View_Column_Record'Class; 
  80.  
  81.    function Convert is new Ada.Unchecked_Conversion 
  82.      (Gtk_Tree_View_Column, System.Address); 
  83.    function Convert is new Ada.Unchecked_Conversion 
  84.      (System.Address, Gtk_Tree_View_Column); 
  85.    package Column_List is new Glib.Glist.Generic_List (Gtk_Tree_View_Column); 
  86.  
  87.    type Gtk_Tree_View_Column_Sizing is 
  88.      (Tree_View_Column_Grow_Only, 
  89.       Tree_View_Column_Autosize, 
  90.       Tree_View_Column_Fixed); 
  91.    pragma Convention (C, Gtk_Tree_View_Column_Sizing); 
  92.  
  93.    procedure Gtk_New (Widget : out Gtk_Tree_View_Column); 
  94.    procedure Initialize (Widget : access Gtk_Tree_View_Column_Record'Class); 
  95.    --  Creates or initializes a new Gtk_Tree_View_Column. 
  96.  
  97.    function Get_Type return Glib.GType; 
  98.    --  Return the internal value associated with this widget. 
  99.  
  100.    --  function Get_Tree_View 
  101.    --    (Tree_Column : access Gtk_Tree_View_Column_Record) 
  102.    --     return Gtk_Tree_View; 
  103.    --  Returns the Gtk_Tree_View wherein Tree_Column has been inserted. 
  104.    --  This function has been relocated to the Gtk.Tree_View package to 
  105.    --  avoid a dependency circularity. 
  106.  
  107.    --------------------------------------- 
  108.    -- Visual representation of the data -- 
  109.    --------------------------------------- 
  110.    --  All the cells in a column have a similar graphical representation. This 
  111.    --  could be either a simple text, an editable text, a toggle button, ... 
  112.    --  This visual representation is independent from the actual data to 
  113.    --  represent. For instance, the same data from the model could be used for 
  114.    --  two different columns, once for a text and once for a button. 
  115.    -- 
  116.    --  The visual representation is specified through a "renderer". See the 
  117.    --  various Gtk.Cell_Renderer* packages for more information on the 
  118.    --  available renderers. 
  119.    -- 
  120.    --  Note that the same renderer can be used for multiple columns, even 
  121.    --  though its properties can be different each time. This means that for 
  122.    --  instance you can instantiate only one Gtk_Cell_Renderer_Text, and use it 
  123.    --  for all the columns that need to display text. 
  124.  
  125.    procedure Pack_Start 
  126.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  127.       Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  128.       Expand      : Boolean); 
  129.    --  Add a renderer to the Tree_Column. 
  130.    --  Multiple renderers can be put in a specific column, and each of them can 
  131.    --  be associated with different data from the model. This provides a very 
  132.    --  powerful way to display different data in the same column. 
  133.  
  134.    procedure Pack_End 
  135.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  136.       Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  137.       Expand      : Boolean); 
  138.    --  Same as the above. See the description of Pack_Start and Pack_End in 
  139.    --  Gtk.Box for the precise difference between the two 
  140.  
  141.    procedure Clear (Tree_Column : access Gtk_Tree_View_Column_Record); 
  142.    --  Remove all the renderers set in the column. 
  143.    --  The column will always be empty until you put some new renderers. 
  144.  
  145.    function Get_Cell_Renderers 
  146.      (Tree_Column : access Gtk_Tree_View_Column_Record) 
  147.       return Gtk.Cell_Renderer.Cell_Renderer_List.Glist; 
  148.    --  Return the list of cell renderers set in the column. The returned list 
  149.    --  must be freed by the caller. 
  150.  
  151.    ------------------------------------ 
  152.    -- Specifying the data to display -- 
  153.    ------------------------------------ 
  154.    --  The data to display in a column is always read from the model associated 
  155.    --  with the tree. In some cases (like if you are using the Gtk_Tree_Store 
  156.    --  model), this means that is has to be physically stored in a data 
  157.    --  structure. However, if you define your own models, you could also 
  158.    --  compute it on the fly. 
  159.    -- 
  160.    --  For instance, if you have a database that contains some distance and 
  161.    --  time information, and you want to display the speed in a tree view: if 
  162.    --  you are using a Gtk_Tree_Store model, you have to create a third column 
  163.    --  in the model to store the string, and have a renderer point to that 
  164.    --  third column. 
  165.    -- 
  166.    --  However, if you are using your own model, it is conceivable that the 
  167.    --  speed is computed on the fly from the distance and time. 
  168.    -- 
  169.    --  The subprograms below use two or three parameters to precisely identify 
  170.    --  the part of the tree they impact: the column, the renderer in the 
  171.    --  column, and in some cases the specific line. 
  172.    -- 
  173.    --  A renderer is always associated with a column in the model (even if that 
  174.    --  is a virtual column not associated with physical data). This is done 
  175.    --  through the Add_Attribute subprogram. This will read the data from the 
  176.    --  model. The type of the data read depends on the type of the column in 
  177.    --  the model. 
  178.    --  The type of data that Add_Attribute excepts to find in the column is 
  179.    --  documented in the packages for each of the renderer. 
  180.  
  181.    procedure Add_Attribute 
  182.      (Tree_Column   : access Gtk_Tree_View_Column_Record; 
  183.       Cell_Renderer : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  184.       Attribute     : String; 
  185.       Column        : Gint); 
  186.    --  Add an attribute mapping to the list in Tree_Column. 
  187.    --  The Column is the column of the model to get a value from, and the 
  188.    --  Attribute is the parameter on Cell_Renderer to be set from the value. So 
  189.    --  for example if column 2 of the model contains strings, you could have 
  190.    --  the "text" attribute of a Gtk_Cell_Renderer_Text get its values from 
  191.    --  column 2. 
  192.    -- 
  193.    --  For a list of properties available for each Cell_Renderer, please 
  194.    --  refer to the corresponding package specifications. 
  195.    -- 
  196.    --  See also the function Set_Cell_Data_Func for another way to query the 
  197.    --  data to display in the tree. 
  198.  
  199.    type Cell_Data_Func is access procedure 
  200.      (Tree_Column : access Gtk_Tree_View_Column_Record'Class; 
  201.       Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  202.       Model       : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; 
  203.       Iter        : Gtk.Tree_Model.Gtk_Tree_Iter); 
  204.    --  This subprogram can be used to globally modify an attribute of the 
  205.    --  Cell renderer. 
  206.    --  It is called every time some event happens in the tree (a line was 
  207.    --  clicked, the mouse moved into or out of a line,...). Iter and 
  208.    --  Tree_Column point to the location in the tree that received the event. 
  209.  
  210.    procedure Set_Cell_Data_Func 
  211.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  212.       Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  213.       Func        : Cell_Data_Func); 
  214.    --  Set the function to use for the column. 
  215.    --  This function is used instead of the standard attributes mapping for 
  216.    --  setting the column value, and should set the value of Tree_Column's cell 
  217.    --  renderer as appropriate. 
  218.    --  Func may be null to remove an older one. 
  219.    --  It should be used when values from the model should be computed from 
  220.    --  application-specific data structures rather than stored in the model. 
  221.  
  222.    generic 
  223.       type Data_Type (<>) is private; 
  224.    package Cell_Data_Functions is 
  225.       type Cell_Data_Func is access procedure 
  226.         (Tree_Column : access Gtk_Tree_View_Column_Record'Class; 
  227.          Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  228.          Model       : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; 
  229.          Iter        : Gtk.Tree_Model.Gtk_Tree_Iter; 
  230.          Data        : Data_Type); 
  231.  
  232.       procedure Set_Cell_Data_Func 
  233.         (Tree_Column : access Gtk_Tree_View_Column_Record'Class; 
  234.          Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  235.          Func        : Cell_Data_Func; 
  236.          Data        : Data_Type); 
  237.  
  238.    private 
  239.       --  <doc_ignore> 
  240.       type Data_Type_Access is access Data_Type; 
  241.  
  242.       type Data_Type_Record is record 
  243.          Func : Cell_Data_Func; 
  244.          Data : Data_Type_Access; 
  245.       end record; 
  246.       type Data_Type_Record_Access is access Data_Type_Record; 
  247.       pragma Convention (C, Data_Type_Record_Access); 
  248.  
  249.       procedure Internal_Destroy_Notify (Data : Data_Type_Record_Access); 
  250.       pragma Convention (C, Internal_Destroy_Notify); 
  251.  
  252.       procedure Internal_Data_Cell_Data_Func 
  253.         (Tree_Column, Cell, Model, Iter : System.Address; 
  254.          Data : Data_Type_Record_Access); 
  255.       pragma Convention (C, Internal_Data_Cell_Data_Func); 
  256.       --  </doc_ignore> 
  257.    end Cell_Data_Functions; 
  258.  
  259.    procedure Clear_Attributes 
  260.      (Tree_Column   : access Gtk_Tree_View_Column_Record; 
  261.       Cell_Renderer : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  262.    --  Clear all existing attributes previously set with 
  263.    --  Gtk.Tree_View_Column.Set_Attributes. 
  264.  
  265.    ------------------------------------------ 
  266.    -- Options for manipulating the columns -- 
  267.    ------------------------------------------ 
  268.  
  269.    procedure Set_Spacing 
  270.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  271.       Spacing     : Gint); 
  272.    function Get_Spacing 
  273.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  274.    --  Set the spacing field of Tree_Column. 
  275.    --  The spacing field is the number of pixels to place between cell 
  276.    --  renderers packed into it. 
  277.  
  278.    procedure Set_Visible 
  279.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  280.       Visible     : Boolean); 
  281.    function Get_Visible 
  282.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  283.    --  Set the visibility of Tree_Column. 
  284.  
  285.    procedure Set_Resizable 
  286.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  287.       Resizable   : Boolean); 
  288.    function Get_Resizable 
  289.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  290.    --  Set whether the Tree_Column is resizable. 
  291.  
  292.    procedure Set_Sizing 
  293.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  294.       The_Type    : Gtk_Tree_View_Column_Sizing); 
  295.    function Get_Sizing 
  296.      (Tree_Column : access Gtk_Tree_View_Column_Record) 
  297.       return Gtk_Tree_View_Column_Sizing; 
  298.    --  Set the growth behavior of Tree_Column to The_Type. 
  299.  
  300.    function Get_Width 
  301.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  302.    --  Return the current size of the Tree_Column in pixels. 
  303.  
  304.    procedure Queue_Resize 
  305.      (Tree_Column : access Gtk_Tree_View_Column_Record); 
  306.    --  Flags the column, and the cell renderers added to this column, to have 
  307.    --  their sizes renegotiated. 
  308.  
  309.    procedure Set_Fixed_Width 
  310.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  311.       Fixed_Width : Gint); 
  312.    function Get_Fixed_Width 
  313.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  314.    --  Set the size of the column in pixels. 
  315.    --  This is meaningful only if the sizing type is 
  316.    --  Gtk_Tree_View_Column_Fixed. In this case, the value is discarded as the 
  317.    --  size of the column is based on the calculated width of the column. The 
  318.    --  width is clamped to the min/max width for the column. 
  319.    --  The value returned by Get_Fixed_width may not be the actual width of the 
  320.    --  column on the screen, just what is requested. 
  321.  
  322.    procedure Set_Min_Width 
  323.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  324.       Min_Width   : Gint); 
  325.    function Get_Min_Width 
  326.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  327.    --  Set the minimum width of the Tree_Column. 
  328.    --  If Min_Width is -1, then the minimum width is unset. 
  329.  
  330.    procedure Set_Max_Width 
  331.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  332.       Max_Width   : Gint); 
  333.    function Get_Max_Width 
  334.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  335.    --  Set the maximum width of the Tree_Column. 
  336.    --  If Max_Width is -1, then the maximum width is unset. 
  337.    --  Note, the column can actually be wider than max width if it's the last 
  338.    --  column in a view. In this case, the column expands to fill the view. 
  339.  
  340.    procedure Clicked (Tree_Column : access Gtk_Tree_View_Column_Record); 
  341.    --  Emit the "clicked" signal on the column. 
  342.    --  This function will only work if the user could have conceivably clicked 
  343.    --  on the button. 
  344.  
  345.    procedure Set_Expand 
  346.      (Tree_Column : access Gtk_Tree_View_Column_Record; Expand : Boolean); 
  347.    function Get_Expand 
  348.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  349.    --  Sets the column to take available extra space. This space is shared 
  350.    --  equally amongst all columns that have the expand set to TRUE. If no 
  351.    --  column has this option set, then the last column gets all extra space. 
  352.    --  By default, every column is created with this FALSE. 
  353.  
  354.    procedure Set_Title 
  355.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  356.       Title       : UTF8_String); 
  357.    function Get_Title 
  358.      (Tree_Column : access Gtk_Tree_View_Column_Record) return UTF8_String; 
  359.    --  Set the title of the Tree_Column. 
  360.    --  If a custom widget has been set, then this value is ignored. 
  361.  
  362.    procedure Set_Clickable 
  363.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  364.       Clickable   : Boolean); 
  365.    function Get_Clickable 
  366.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  367.    --  Set the header to be active if Active is True. 
  368.    --  When the header is active, then it can take keyboard focus, and can be 
  369.    --  clicked. 
  370.  
  371.    procedure Set_Widget 
  372.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  373.       Widget      : access Gtk.Widget.Gtk_Widget_Record'Class); 
  374.    function Get_Widget 
  375.      (Tree_Column : access Gtk_Tree_View_Column_Record) 
  376.        return Gtk.Widget.Gtk_Widget; 
  377.    --  Return the Gtk_Widget in the button in the column header. 
  378.    --  If a custom widget has not been set, then this will be a Gtk_Alignment 
  379.    --  with a Gtk_Label in it. 
  380.  
  381.    procedure Set_Alignment 
  382.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  383.       Xalign      : Gfloat); 
  384.    function Get_Alignment 
  385.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gfloat; 
  386.    --  Set the alignment of the title or custom widget inside the column header 
  387.    --  The alignment determines its location inside the button 
  388.    --  0.0 for left, 0.5 for center, 1.0 for right. 
  389.  
  390.    procedure Set_Reorderable 
  391.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  392.       Reorderable : Boolean); 
  393.    function Get_Reorderable 
  394.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  395.    --  Whether this column can be drag-and-dropped to some other place in the 
  396.    --  tree. 
  397.  
  398.    procedure Set_Sort_Column_Id 
  399.      (Tree_Column    : access Gtk_Tree_View_Column_Record; 
  400.       Sort_Column_Id : Gint); 
  401.    function Get_Sort_Column_Id 
  402.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gint; 
  403.    --  Set the logical model columns that this column sorts on when this 
  404.    --  column is selected for sorting. Doing so makes the column header 
  405.    --  clickable. 
  406.    --  Get_Sort_Column_Id returns -1 if this column can't be used for sorting. 
  407.  
  408.    procedure Set_Sort_Indicator 
  409.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  410.       Setting     : Boolean); 
  411.    function Get_Sort_Indicator 
  412.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  413.    --  Call this function with a Setting of True to display an arrow in 
  414.    --  the header button indicating the column is sorted. Call 
  415.    --  Set_Sort_Order to change the direction of the arrow. 
  416.  
  417.    procedure Set_Sort_Order 
  418.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  419.       Order       : Gtk_Sort_Type); 
  420.    function Get_Sort_Order 
  421.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Gtk_Sort_Type; 
  422.    --  Change the appearance of the sort indicator. 
  423.    --  This does *not* actually sort the model. Use 
  424.    --  Gtk.Tree_View_Column.Set_Sort_Column_Id if you want automatic sorting 
  425.    --  support. This function is primarily for custom sorting behavior, and 
  426.    --  should be used in conjunction with Gtk.Tree_Sortable.Set_Sort_Column 
  427.    --  to do that. For custom models, the mechanism will vary. The sort 
  428.    --  indicator changes direction to indicate normal sort or reverse sort. 
  429.    --  Note that you must have the sort indicator enabled to see anything 
  430.    --  when calling this function; see Set_Sort_Indicator. 
  431.  
  432.    procedure Cell_Set_Cell_Data 
  433.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  434.       Tree_Model  : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class; 
  435.       Iter        : Gtk.Tree_Model.Gtk_Tree_Iter; 
  436.       Is_Expander : Boolean; 
  437.       Is_Expanded : Boolean); 
  438.    --  Set the cell renderer based on the Tree_Model and Tree_Node. 
  439.    --  That is, for every attribute mapping in Tree_Column, it will get a 
  440.    --  value from the set column on the Tree_Node, and use that value to 
  441.    --  set the attribute on the cell renderer.  This is used primarily by 
  442.    --  the Gtk_Tree_View. 
  443.  
  444.    procedure Cell_Get_Size 
  445.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  446.       Cell_Area   : Gdk.Rectangle.Gdk_Rectangle; 
  447.       X_Offset    : out Gint; 
  448.       Y_Offset    : out Gint; 
  449.       Width       : out Gint; 
  450.       Height      : out Gint); 
  451.    --  Obtain the width and height needed to render the column. 
  452.    --  This is used primarily by the Gtk_Tree_View. 
  453.  
  454.    function Cell_Is_Visible 
  455.      (Tree_Column : access Gtk_Tree_View_Column_Record) return Boolean; 
  456.    --  Returns true if any of the cells packed in the column is visible 
  457.  
  458.    procedure Cell_Get_Position 
  459.      (Tree_Column   : access Gtk_Tree_View_Column_Record; 
  460.       Cell_Renderer : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  461.       Start_Pos     : out Gint; 
  462.       Width         : out Gint; 
  463.       Success       : out Boolean); 
  464.    --  Obtains the horizontal position and size of a cell in a column. If the 
  465.    --  cell is not found in the column, start_pos and width are not changed 
  466.    --  and FALSE is returned. 
  467.  
  468.    procedure Focus_Cell 
  469.      (Tree_Column : access Gtk_Tree_View_Column_Record; 
  470.       Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  471.    --  Sets the current keyboard focus to be at Cell, if the column contains 
  472.    --  2 or more editable and activatable cells. 
  473.  
  474.    ---------------- 
  475.    -- Properties -- 
  476.    ---------------- 
  477.  
  478.    --  <properties> 
  479.    --  The following properties are defined for this widget. See 
  480.    --  Glib.Properties for more information on properties. 
  481.    -- 
  482.    --  Name:  Alignment_Property 
  483.    --  Type:  Float 
  484.    --  Descr: X Alignment of the column header text or widget 
  485.    -- 
  486.    --  Name:  Clickable_Property 
  487.    --  Type:  Boolean 
  488.    --  Descr: Whether the header can be clicked 
  489.    -- 
  490.    --  Name:  Expand_Property 
  491.    --  Type:  Boolean 
  492.    --  Descr: Column gets share of extra width allocated to the widget 
  493.    -- 
  494.    --  Name:  Fixed_Width_Property 
  495.    --  Type:  Int 
  496.    --  Descr: Current fixed width of the column 
  497.    -- 
  498.    --  Name:  Max_Width_Property 
  499.    --  Type:  Int 
  500.    --  Descr: Maximum allowed width of the column 
  501.    -- 
  502.    --  Name:  Min_Width_Property 
  503.    --  Type:  Int 
  504.    --  Descr: Minimum allowed width of the column 
  505.    -- 
  506.    --  Name:  Reorderable_Property 
  507.    --  Type:  Boolean 
  508.    --  Descr: Whether the column can be reordered around the headers 
  509.    -- 
  510.    --  Name:  Resizable_Property 
  511.    --  Type:  Boolean 
  512.    --  Descr: Column is user-resizable 
  513.    -- 
  514.    --  Name:  Sizing_Property 
  515.    --  Type:  Enum 
  516.    --  Descr: Resize mode of the column 
  517.    -- 
  518.    --  Name:  Sort_Indicator_Property 
  519.    --  Type:  Boolean 
  520.    --  Descr: Whether to show a sort indicator 
  521.    -- 
  522.    --  Name:  Sort_Order_Property 
  523.    --  Type:  Enum 
  524.    --  Descr: Sort direction the sort indicator should indicate 
  525.    -- 
  526.    --  Name:  Spacing_Property 
  527.    --  Type:  Int 
  528.    --  Descr: Space which is inserted between cells 
  529.    -- 
  530.    --  Name:  Title_Property 
  531.    --  Type:  String 
  532.    --  Descr: Title to appear in column header 
  533.    -- 
  534.    --  Name:  Visible_Property 
  535.    --  Type:  Boolean 
  536.    --  Descr: Whether to display the column 
  537.    -- 
  538.    --  Name:  Widget_Property 
  539.    --  Type:  Object 
  540.    --  Descr: Widget to put in column header button instead of column title 
  541.    -- 
  542.    --  Name:  Width_Property 
  543.    --  Type:  Int 
  544.    --  Descr: Current width of the column 
  545.    -- 
  546.    --  </properties> 
  547.  
  548.    package Column_Sizing_Properties is new 
  549.      Glib.Generic_Properties.Generic_Internal_Discrete_Property 
  550.        (Gtk_Tree_View_Column_Sizing); 
  551.    type Property_Column_Sizing is new Column_Sizing_Properties.Property; 
  552.  
  553.    Alignment_Property      : constant Glib.Properties.Property_Float; 
  554.    Clickable_Property      : constant Glib.Properties.Property_Boolean; 
  555.    Expand_Property         : constant Glib.Properties.Property_Boolean; 
  556.    Fixed_Width_Property    : constant Glib.Properties.Property_Int; 
  557.    Max_Width_Property      : constant Glib.Properties.Property_Int; 
  558.    Min_Width_Property      : constant Glib.Properties.Property_Int; 
  559.    Reorderable_Property    : constant Glib.Properties.Property_Boolean; 
  560.    Resizable_Property      : constant Glib.Properties.Property_Boolean; 
  561.    Sizing_Property         : constant Property_Column_Sizing; 
  562.    Sort_Indicator_Property : constant Glib.Properties.Property_Boolean; 
  563.    Sort_Order_Property     : constant Gtk.Enums.Property_Sort_Type; 
  564.    Spacing_Property        : constant Glib.Properties.Property_Int; 
  565.    Title_Property          : constant Glib.Properties.Property_String; 
  566.    Visible_Property        : constant Glib.Properties.Property_Boolean; 
  567.    Widget_Property         : constant Glib.Properties.Property_Object; 
  568.    Width_Property          : constant Glib.Properties.Property_Int; 
  569.  
  570.    ------------- 
  571.    -- Signals -- 
  572.    ------------- 
  573.  
  574.    --  <signals> 
  575.    --  The following new signals are defined for this widget: 
  576.    -- 
  577.    --  - "clicked" 
  578.    --    procedure Handler (Widget : access Gtk_Tree_View_Column_Record'Class); 
  579.    -- 
  580.    --  </signals> 
  581.  
  582.    Signal_Clicked : constant Glib.Signal_Name := "clicked"; 
  583.  
  584. private 
  585.    type Gtk_Tree_View_Column_Record is 
  586.      new Gtk.Object.Gtk_Object_Record with null record; 
  587.  
  588.       Alignment_Property : constant Glib.Properties.Property_Float := 
  589.      Glib.Properties.Build ("alignment"); 
  590.    Clickable_Property : constant Glib.Properties.Property_Boolean := 
  591.      Glib.Properties.Build ("clickable"); 
  592.    Expand_Property : constant Glib.Properties.Property_Boolean := 
  593.      Glib.Properties.Build ("expand"); 
  594.    Fixed_Width_Property : constant Glib.Properties.Property_Int := 
  595.      Glib.Properties.Build ("fixed-width"); 
  596.    Max_Width_Property : constant Glib.Properties.Property_Int := 
  597.      Glib.Properties.Build ("max-width"); 
  598.    Min_Width_Property : constant Glib.Properties.Property_Int := 
  599.      Glib.Properties.Build ("min-width"); 
  600.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  601.      Glib.Properties.Build ("reorderable"); 
  602.    Resizable_Property : constant Glib.Properties.Property_Boolean := 
  603.      Glib.Properties.Build ("resizable"); 
  604.    Sizing_Property : constant Property_Column_Sizing := 
  605.      Build ("sizing"); 
  606.    Sort_Indicator_Property : constant Glib.Properties.Property_Boolean := 
  607.      Glib.Properties.Build ("sort-indicator"); 
  608.    Sort_Order_Property : constant Gtk.Enums.Property_Sort_Type := 
  609.      Gtk.Enums.Build ("sort-order"); 
  610.    Spacing_Property : constant Glib.Properties.Property_Int := 
  611.      Glib.Properties.Build ("spacing"); 
  612.    Title_Property : constant Glib.Properties.Property_String := 
  613.      Glib.Properties.Build ("title"); 
  614.    Visible_Property : constant Glib.Properties.Property_Boolean := 
  615.      Glib.Properties.Build ("visible"); 
  616.    Widget_Property : constant Glib.Properties.Property_Object := 
  617.      Glib.Properties.Build ("widget"); 
  618.    Width_Property : constant Glib.Properties.Property_Int := 
  619.      Glib.Properties.Build ("width"); 
  620.  
  621.    pragma Import (C, Get_Type, "gtk_tree_view_column_get_type"); 
  622. end Gtk.Tree_View_Column; 
  623.  
  624. --  No binding: gtk_tree_view_column_new_with_attributes 
  625. --  No binding: gtk_tree_view_column_set_attributes 
  626.  
  627. --  Implemented in Gtk.Tree_View: 
  628. --  No binding: gtk_tree_view_column_get_tree_view