1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-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. --  See extended documentation in Gtk.Tree_View_Column and Gtk.Tree_Store. 
  31. --  </description> 
  32. --  <c_version>2.16.6</c_version> 
  33. --  <group>Trees and Lists</group> 
  34. --  <testgtk>create_tree_view.adb</testgtk> 
  35. --  <screenshot>gtk-tree_view</screenshot> 
  36.  
  37. with Glib.Properties; 
  38. with Gdk.Dnd; 
  39. with Gdk.Pixmap; 
  40. with Gdk.Rectangle; 
  41. with Gdk.Types; 
  42. with Gdk.Window; 
  43. with Gtk; 
  44. with Gtk.Adjustment; 
  45. with Gtk.Cell_Renderer; 
  46. with Gtk.Container; 
  47. with Gtk.Enums; 
  48. with Gtk.GEntry; 
  49. with Gtk.Selection; 
  50. with Gtk.Tooltip; 
  51. with Gtk.Tree_Model; 
  52. with Gtk.Tree_Selection; 
  53. with Gtk.Tree_View_Column; 
  54. with Interfaces.C.Strings; 
  55.  
  56. package Gtk.Tree_View is 
  57.  
  58.    type Gtk_Tree_View_Record is 
  59.      new Gtk.Container.Gtk_Container_Record with private; 
  60.    type Gtk_Tree_View is access all Gtk_Tree_View_Record'Class; 
  61.  
  62.    type Gtk_Tree_View_Drop_Position is 
  63.      (Tree_View_Drop_Before, 
  64.       Tree_View_Drop_After, 
  65.       Tree_View_Drop_Into_Or_Before, 
  66.       Tree_View_Drop_Into_Or_After); 
  67.    pragma Convention (C, Gtk_Tree_View_Drop_Position); 
  68.  
  69.    procedure Gtk_New (Widget : out Gtk_Tree_View); 
  70.    procedure Initialize (Widget : access Gtk_Tree_View_Record'Class); 
  71.    --  Creates or initializes a new tree view 
  72.  
  73.    function Get_Type return Gtk.Gtk_Type; 
  74.    --  Return the internal value associated with this widget. 
  75.  
  76.    procedure Gtk_New 
  77.      (Widget : out Gtk_Tree_View; 
  78.       Model  : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class); 
  79.  
  80.    procedure Initialize 
  81.      (Widget : access Gtk_Tree_View_Record'Class; 
  82.       Model  : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class); 
  83.    --  Internal initialization function. 
  84.    --  See the section "Creating your own widgets" in the documentation. 
  85.  
  86.    procedure Set_Model 
  87.      (Tree_View : access Gtk_Tree_View_Record; 
  88.       Model     : Gtk.Tree_Model.Gtk_Tree_Model); 
  89.    function Get_Model 
  90.      (Tree_View : access Gtk_Tree_View_Record) 
  91.       return Gtk.Tree_Model.Gtk_Tree_Model; 
  92.    --  Sets the model for a Gtk_Tree_View.  If the Tree_View already has a 
  93.    --  model set, it will remove it before setting the new model. 
  94.    --  If Model is Null, then it will unset the old model. 
  95.  
  96.    function Get_Selection 
  97.      (Tree_View : access Gtk_Tree_View_Record) 
  98.       return Gtk.Tree_Selection.Gtk_Tree_Selection; 
  99.    --  Gets the Gtk_Tree_Selection associated with Tree_View. 
  100.  
  101.    procedure Set_Hadjustment 
  102.      (Tree_View  : access Gtk_Tree_View_Record; 
  103.       Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  104.    function Get_Hadjustment 
  105.      (Tree_View : access Gtk_Tree_View_Record) 
  106.       return Gtk.Adjustment.Gtk_Adjustment; 
  107.    --  Sets or gets the Gtk_Adjustment for the current horizontal aspect. 
  108.  
  109.    procedure Set_Vadjustment 
  110.      (Tree_View  : access Gtk_Tree_View_Record; 
  111.       Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  112.    function Get_Vadjustment 
  113.      (Tree_View : access Gtk_Tree_View_Record) 
  114.       return Gtk.Adjustment.Gtk_Adjustment; 
  115.    --  Sets or Gets the Gtk_Adjustment currently being used for the vertical 
  116.    --  aspect. 
  117.  
  118.    function Get_Enable_Tree_Lines 
  119.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  120.    procedure Set_Enable_Tree_Lines 
  121.      (Tree_View : access Gtk_Tree_View_Record; 
  122.       Enabled   : Boolean); 
  123.    --  Whether to draw lines interconnecting the expanders in Tree_View. 
  124.    --  This does not have any visible effects for lists. 
  125.  
  126.    function Get_Grid_Lines 
  127.      (Tree_View : access Gtk_Tree_View_Record) return Gtk.Enums.Gtk_Grid_Lines; 
  128.    procedure Set_Grid_Lines 
  129.      (Tree_View  : access Gtk_Tree_View_Record; 
  130.       Grid_Lines : Gtk.Enums.Gtk_Grid_Lines); 
  131.    --  Which grid lines to draw in Tree_View. 
  132.  
  133.    function Get_Level_Indentation 
  134.      (Tree_View : access Gtk_Tree_View_Record) return Gint; 
  135.    procedure Set_Level_Indentation 
  136.      (Tree_View   : access Gtk_Tree_View_Record; 
  137.       Indentation : Gint); 
  138.    --  Sets the amount of extra indentation for child levels to use in 
  139.    --  Tree_View in addition to the default indentation.  The value should be 
  140.    --  specified in pixels, a value of 0 disables this feature and in this case 
  141.    --  only the default indentation will be used. 
  142.    --  This does not have any visible effects for lists. 
  143.  
  144.    function Get_Rubber_Banding 
  145.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  146.    procedure Set_Rubber_Banding 
  147.      (Tree_View : access Gtk_Tree_View_Record; 
  148.       Enable    : Boolean); 
  149.    --  Enables or disables rubber banding in Tree_View.  If the selection mode 
  150.    --  is Selection_Multiple, rubber banding will allow the user to select 
  151.    --  multiple rows by dragging the mouse. 
  152.  
  153.    function Is_Rubber_Banding_Active 
  154.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  155.    --  Returns whether a rubber banding operation is currently being done 
  156.    --  in Tree_View. 
  157.  
  158.    function Get_Show_Expanders 
  159.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  160.    procedure Set_Show_Expanders 
  161.      (Tree_View : access Gtk_Tree_View_Record; 
  162.       Enabled   : Boolean); 
  163.    --  Whether to draw and enable expanders and indent child rows in Tree_View. 
  164.    --  When disabled there will be no expanders visible in trees and there will 
  165.    --  be no way to expand and collapse rows by default.  Also note that hiding 
  166.    --  the expanders will disable the default indentation.  You can set a 
  167.    --  custom indentation in this case using Set_Level_Indentation. 
  168.    --  This does not have any visible effects for lists. 
  169.  
  170.    ---------------------------------- 
  171.    -- Column and header operations -- 
  172.    ---------------------------------- 
  173.  
  174.    procedure Set_Headers_Visible 
  175.      (Tree_View       : access Gtk_Tree_View_Record; 
  176.       Headers_Visible : Boolean); 
  177.    function Get_Headers_Visible 
  178.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  179.    --  Returns True if the headers on the Tree_View are visible. 
  180.  
  181.    procedure Columns_Autosize (Tree_View : access Gtk_Tree_View_Record); 
  182.    --  Resizes all columns to their optimal width. 
  183.  
  184.    function Get_Headers_Clickable 
  185.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  186.    procedure Set_Headers_Clickable 
  187.      (Tree_View : access Gtk_Tree_View_Record; 
  188.       Setting   : Boolean); 
  189.    --  Allow the column title buttons to be clicked. 
  190.  
  191.    procedure Set_Rules_Hint 
  192.      (Tree_View : access Gtk_Tree_View_Record; 
  193.       Setting   : Boolean); 
  194.    function Get_Rules_Hint 
  195.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  196.    --  This function tells GtkAda that the user interface for your 
  197.    --  application requires users to read across tree rows and associate 
  198.    --  cells with one another. By default, GtkAda will then render the tree 
  199.    --  with alternating row colors. Do *not* use it just because you prefer the 
  200.    --  appearance of the ruled tree; that's a question for the theme. Some 
  201.    --  themes will draw tree rows in alternating colors even when rules are 
  202.    --  turned off, and users who prefer that appearance all the time can choose 
  203.    --  those themes. You should call this function only as a *semantic* 
  204.    --  hint to the theme engine that your tree makes alternating colors 
  205.    --  useful from a functional standpoint (since it has lots of columns, 
  206.    --  generally). 
  207.  
  208.    ----------------------------- 
  209.    -- Public Column functions -- 
  210.    ----------------------------- 
  211.  
  212.    function Append_Column 
  213.      (Tree_View : access Gtk_Tree_View_Record; 
  214.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column) return Gint; 
  215.    --  Append Column to the list of columns. 
  216.  
  217.    function Remove_Column 
  218.      (Tree_View : access Gtk_Tree_View_Record; 
  219.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column) return Gint; 
  220.    --  Remove Column from Tree_View. 
  221.    --  Return value: The number of columns in Tree_View after removing. 
  222.  
  223.    function Insert_Column 
  224.      (Tree_View : access Gtk_Tree_View_Record; 
  225.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  226.       Position  : Gint := -1) return Gint; 
  227.    --  Insert the Column into the Tree_View at Position. 
  228.    --  If Position is -1, then the column is inserted at the end. 
  229.    --  Return the number of columns in Tree_View after insertion. 
  230.  
  231.    function Insert_Column_With_Data_Func 
  232.      (Tree_View : access Gtk_Tree_View_Record; 
  233.       Position  : Gint; 
  234.       Title     : String; 
  235.       Cell      : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  236.       Func      : Gtk.Tree_View_Column.Cell_Data_Func) 
  237.       return Gint; 
  238.    --  Convenience function that inserts a new column into the tree view 
  239.    --  with the given cell renderer and a function to set cell renderer 
  240.    --  attributes (normally using data from the model). See also 
  241.    --  Gtk.Tree_View_Column.Set_Cell_Data_Func and 
  242.    --  Gtk.Tree_View_Column.Pack_Start. 
  243.    --  If Tree_View has "fixed_height" mode enabled, then Column must have its 
  244.    --  "sizing" property set to be TREE_VIEW_COLUMN_FIXED. 
  245.    -- 
  246.    --  Return value: number of columns in the tree view post-insert 
  247.  
  248.    function Get_Column 
  249.      (Tree_View : access Gtk_Tree_View_Record; 
  250.       N         : Gint) 
  251.       return Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  252.    --  Gets the Gtk_Tree_View_Column at the given position in the Tree_View. 
  253.  
  254.    function Get_Tree_View 
  255.      (Tree_Column : access Gtk.Tree_View_Column.Gtk_Tree_View_Column_Record) 
  256.       return Gtk_Tree_View; 
  257.    --  Returns the Gtk_Tree_View wherein Tree_Column has been inserted.  If 
  258.    --  Column is currently not inserted in any tree view, null is 
  259.    --  returned. 
  260.  
  261.    function Get_Columns 
  262.      (Tree_View : access Gtk_Tree_View_Record) 
  263.       return Gtk.Tree_View_Column.Column_List.Glist; 
  264.    --  Return a list of all the Gtk_Tree_View_Column s currently in Tree_View. 
  265.    --  The returned list must be freed with g_list_free (). 
  266.  
  267.    procedure Move_Column_After 
  268.      (Tree_View   : access Gtk_Tree_View_Record; 
  269.       Column      : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  270.       Base_Column : Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  271.    --  Move Column to be after to Base_Column.  If Base_Column is Null, then 
  272.    --  Column is placed in the first position. 
  273.  
  274.    procedure Set_Expander_Column 
  275.      (Tree_View : access Gtk_Tree_View_Record; 
  276.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  277.    --  Set the column to draw the expander arrow at. It must be in Tree_View. 
  278.    --  If Column is Null, then the expander arrow is fixed at the first column. 
  279.  
  280.    function Get_Expander_Column 
  281.      (Tree_View : access Gtk_Tree_View_Record) 
  282.       return Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  283.    --  Return the column that is the current expander column. 
  284.    --  This column has the expander arrow drawn next to it. 
  285.  
  286.    procedure Scroll_To_Point 
  287.      (Tree_View : access Gtk_Tree_View_Record; 
  288.       Tree_X    : Gint; 
  289.       Tree_Y    : Gint); 
  290.    --  Scroll the tree view such that the top-left corner of the visible 
  291.    --  area is Tree_X, Tree_Y, where Tree_X and Tree_Y are specified 
  292.    --  in tree window coordinates. The Tree_View must be realized before 
  293.    --  this function is called. If it isn't, you probably want to be 
  294.    --  using Scroll_To_Cell. 
  295.  
  296.    procedure Scroll_To_Cell 
  297.      (Tree_View : access Gtk_Tree_View_Record; 
  298.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  299.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  300.       Use_Align : Boolean; 
  301.       Row_Align : Gfloat; 
  302.       Col_Align : Gfloat); 
  303.    --  Move the alignments of Tree_View to the position specified by Column and 
  304.    --  Path. If Column is Null, then no horizontal scrolling occurs. Likewise, 
  305.    --  if Path is Null no vertical scrolling occurs. Row_Align determines where 
  306.    --  the row is placed, and Col_align determines where Column is placed. Both 
  307.    --  are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 
  308.    --  1.0 means right/bottom alignment, 0.5 means center. 
  309.    --  If Use_Align is False, then the alignment arguments are ignored, and the 
  310.    --  tree does the minimum amount of work to scroll the cell onto the screen. 
  311.  
  312.    procedure Get_Visible_Range 
  313.      (Tree_View  : access Gtk_Tree_View_Record; 
  314.       Start_Path : out Gtk.Tree_Model.Gtk_Tree_Path; 
  315.       End_Path   : out Gtk.Tree_Model.Gtk_Tree_Path; 
  316.       Success    : out Boolean); 
  317.    --  Sets Start_path and End_path to be the first and last visible path. 
  318.    --  Note that there may be invisible paths in between. 
  319.    --  The paths should be freed with Free after use. 
  320.  
  321.    procedure Row_Activated 
  322.      (Tree_View : access Gtk_Tree_View_Record; 
  323.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  324.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  325.    --  Activate the cell determined by Path and Column. 
  326.  
  327.    procedure Expand_All (Tree_View : access Gtk_Tree_View_Record); 
  328.    --  Recursively expand all nodes in the Tree_View. 
  329.  
  330.    procedure Collapse_All (Tree_View : access Gtk_Tree_View_Record); 
  331.    --  Recursively collapse all visible, expanded nodes in Tree_View. 
  332.  
  333.    function Expand_Row 
  334.      (Tree_View : access Gtk_Tree_View_Record; 
  335.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  336.       Open_All  : Boolean) return Boolean; 
  337.    --  Open the row so its children are visible 
  338.    --  Return True if the row existed and had children 
  339.  
  340.    procedure Expand_To_Path 
  341.      (Tree_View : access Gtk_Tree_View_Record; 
  342.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  343.    --  Expands the row at Path. This will also expand all parent rows of 
  344.    --  Path as necessary. 
  345.  
  346.    type Gtk_Tree_View_Mapping_Func is access 
  347.      procedure (Tree_View : System.Address;  --  Gtk_Tree_View 
  348.                 Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  349.                 User_Data : System.Address); 
  350.    pragma Convention (C, Gtk_Tree_View_Mapping_Func); 
  351.    --  Function called on each matching row. Since this is low-level, you must 
  352.    --  convert Tree_View to a proper Gtk_Tree_View with 
  353.    --     Tree := Gtk_Tree_View (Gtk.Widget.Convert (Tree_View)); 
  354.  
  355.    procedure Map_Expanded_Rows 
  356.      (Tree_View : access Gtk_Tree_View_Record; 
  357.       Func      : Gtk_Tree_View_Mapping_Func; 
  358.       Data      : System.Address); 
  359.    --  Calls Func on all expanded rows. 
  360.  
  361.    function Collapse_Row 
  362.      (Tree_View : access Gtk_Tree_View_Record; 
  363.       Path      : Gtk.Tree_Model.Gtk_Tree_Path) return Boolean; 
  364.    --  Collapse a row (hides its child rows, if they exist.) 
  365.  
  366.    function Row_Expanded 
  367.      (Tree_View : access Gtk_Tree_View_Record; 
  368.       Path      : Gtk.Tree_Model.Gtk_Tree_Path) return Boolean; 
  369.    --  Return True if the node pointed to by Path is expanded in Tree_View. 
  370.  
  371.    procedure Set_Fixed_Height_Mode 
  372.      (Tree_View : access Gtk_Tree_View_Record; Enable : Boolean); 
  373.    function Get_Fixed_Height_Mode 
  374.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  375.    --  Enables or disables the fixed height mode of tree_view. 
  376.    --  Fixed height mode speeds up the rendering by assuming that all 
  377.    --  rows have the same height. 
  378.    --  Only enable this option if all rows are the same height and all 
  379.    --  columns are of type TREE_VIEW_COLUMN_FIXED. 
  380.  
  381.    procedure Set_Hover_Expand 
  382.      (Tree_View : access Gtk_Tree_View_Record; Expand : Boolean); 
  383.    function Get_Hover_Expand 
  384.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  385.    --  Enables of disables the hover expansion mode of Tree_view. 
  386.    --  Hover expansion makes rows expand or collaps if the pointer 
  387.    --  moves over them. 
  388.  
  389.    procedure Set_Hover_Selection 
  390.      (Tree_View : access Gtk_Tree_View_Record; Hover : Boolean); 
  391.    function Get_Hover_Selection 
  392.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  393.    --  Enables of disables the hover selection mode of Tree_View. 
  394.    --  Hover selection makes the selected row follow the pointer. 
  395.    --  Currently, this works only for the selection modes 
  396.    --  SELECTION_SINGLE and SELECTION_BROWSE. 
  397.  
  398.    procedure Set_Cursor 
  399.      (Tree_View     : access Gtk_Tree_View_Record; 
  400.       Path          : Gtk.Tree_Model.Gtk_Tree_Path; 
  401.       Focus_Column  : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  402.       Start_Editing : Boolean); 
  403.    --  Sets the current keyboard focus to be at Path, and selects it.  This is 
  404.    --  useful when you want to focus the user's attention on a particular row. 
  405.    --  If Column is not Null, then focus is given to that column. 
  406.    --  Additionally, if Column is specified, and Start_Editing is True, then 
  407.    --  editing should be started in the specified cell. 
  408.    --  Keyboard focus is given to the widget after this is called. 
  409.    --  Please note that editing can only happen when the widget is realized. 
  410.  
  411.    procedure Get_Cursor 
  412.      (Tree_View    : access Gtk_Tree_View_Record; 
  413.       Path         : out Gtk.Tree_Model.Gtk_Tree_Path; 
  414.       Focus_Column : out Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  415.    --  Fills in Path and Focus_Column with the current path and focus column. 
  416.    --  If the cursor isn't currently set, then *path will be Null. If no column 
  417.    --  currently has focus, then *focus_column will be Null. 
  418.  
  419.    procedure Set_Cursor_On_Cell 
  420.      (Tree_View     : access Gtk_Tree_View_Record; 
  421.       Path          : Gtk.Tree_Model.Gtk_Tree_Path; 
  422.       Focus_Column  : Gtk.Tree_View_Column.Gtk_Tree_View_Column := null; 
  423.       Focus_Cell    : Gtk.Cell_Renderer.Gtk_Cell_Renderer := null; 
  424.       Start_Editing : Boolean); 
  425.    --  Sets the current keyboard focus to be at Path, and selects it. This is 
  426.    --  useful when you want to focus the user's attention on a particular row. 
  427.    --  If Focus_Column is not null, then focus is given to the column specified 
  428.    --  by it. If Focus_Column and Focus_Cell are not null, and Focus_Column 
  429.    --  contains 2 or more editable or activatable cells, then focus is given to 
  430.    --  the cell specified by Focus_Cell. Additionally, if Focus_Column is 
  431.    --  specified, and Start_Editing is true, then editing should be started in 
  432.    --  the specified cell. This function is often followed by 
  433.    --  gtk.widget.grab_focus (Tree_View) in order to give keyboard focus to the 
  434.    --  widget. Please note that editing can only happen when the widget is 
  435.    --  realized. 
  436.  
  437.    function Get_Bin_Window 
  438.      (Tree_View : access Gtk_Tree_View_Record) return Gdk.Window.Gdk_Window; 
  439.    --  Return the window that Tree_View renders to. 
  440.    --  This is used primarily to compare to Get_Window (Event) to confirm that 
  441.    --  the event on Tree_View is on the right window. 
  442.  
  443.    type Gtk_Tree_View_Row_Separator_Func is access 
  444.      function (Model     : System.Address; 
  445.                Iter      : Gtk.Tree_Model.Gtk_Tree_Iter; 
  446.                User_Data : System.Address) return Gboolean; 
  447.    pragma Convention (C, Gtk_Tree_View_Row_Separator_Func); 
  448.    --  This function is used to determine whether a row should be drawn with a 
  449.    --  separator. If it returns True, a separator is displayed. 
  450.    --  This is a low-level function, since it isn't used very often, and you 
  451.    --  should convert the Model to a Gtk_Tree_Model with 
  452.    --     declare 
  453.    --        Stub : Gtk_Tree_Model_Record; 
  454.    --     begin 
  455.    --        My_Model := Gtk_Tree_Model (Get_User_Data (Model, Stub)); 
  456.    --     end; 
  457.  
  458.    procedure Set_Row_Separator_Func 
  459.      (Tree_View : access Gtk_Tree_View_Record; 
  460.       Func      : Gtk_Tree_View_Row_Separator_Func; 
  461.       Data      : System.Address; 
  462.       Destroy   : Glib.G_Destroy_Notify_Address := null); 
  463.    function Get_Row_Separator_Func 
  464.      (Tree_View : access Gtk_Tree_View_Record) 
  465.       return Gtk_Tree_View_Row_Separator_Func; 
  466.    --  Sets the row separator function, which is used to determine 
  467.    --  whether a row should be drawn as a separator. If the row separator 
  468.    --  function is NULL, no separators are drawn. This is the default value. 
  469.  
  470.    procedure Get_Path_At_Pos 
  471.      (Tree_View : access Gtk_Tree_View_Record; 
  472.       X         : Gint; 
  473.       Y         : Gint; 
  474.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  475.       Column    : out Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  476.       Cell_X    : out Gint; 
  477.       Cell_Y    : out Gint; 
  478.       Row_Found : out Boolean); 
  479.    --  Find the path at the point (X, Y) relative to Window. 
  480.    --  If Window is null, then the point is found relative to the widget 
  481.    --  coordinates. This function is expected to be called after an event. 
  482.    --  It is primarily for things like popup menus. Path will be filled 
  483.    --  with the Gtk_Tree_Path at that point. It should be freed with 
  484.    --  Tree_Path_Free. Column will be filled with the column at that point. 
  485.    --  Cell_X and Cell_Y return the coordinates relative to the cell background 
  486.    --  (i.e. the background_area passed to gtk_cell_renderer_render()). 
  487.    --  This function only works if Tree_View is realized. 
  488.    --  Row_Found is set to True if a row exists at that coordinate. 
  489.  
  490.    procedure Get_Cell_Area 
  491.      (Tree_View : access Gtk_Tree_View_Record; 
  492.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  493.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  494.       Rect      : out Gdk.Rectangle.Gdk_Rectangle); 
  495.    --  Fills the bounding rectangle in tree window coordinates for the cell at 
  496.    --  the row specified by Path and the column specified by Column. If Path is 
  497.    --  Null, or points to a path not currently displayed, the Y and Height 
  498.    --  fields of the rectangle will be filled with 0. If Column is Null, 
  499.    --  the X and Width fields will be filled with 0. 
  500.    --  The sum of all cell rects does not cover the entire tree; 
  501.    --  there are extra pixels in between rows, for example. The 
  502.    --  returned rectangle is equivalent to the Cell_Area passed to 
  503.    --  gtk_cell_renderer_render().  This function is only valid if Tree_View is 
  504.    --  realized. 
  505.  
  506.    procedure Get_Background_Area 
  507.      (Tree_View : access Gtk_Tree_View_Record; 
  508.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  509.       Column    : Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  510.       Rect      : out Gdk.Rectangle.Gdk_Rectangle); 
  511.    --  Fills the bounding rectangle in tree window coordinates for the cell 
  512.    --  at the row specified by Path and the column specified by Column.  If 
  513.    --  Path is Null, or points to a node not found in the tree, the Y and 
  514.    --  Height fields of the rectangle will be filled with 0. If Column is Null, 
  515.    --  the X and Width fields will be filled with 0. 
  516.    --  The returned rectangle is equivalent to the Background_Area passed to 
  517.    --  Gtk.Cell_Renderer.Render.  These background areas tile to cover the 
  518.    --  entire tree window (except for the area used for 
  519.    --  header buttons). Contrast with the cell_area, returned by 
  520.    --  gtk_tree_view_get_cell_area(), which returns only the cell itself, 
  521.    --  excluding surrounding borders and the tree expander area. 
  522.  
  523.    procedure Get_Visible_Rect 
  524.      (Tree_View    : access Gtk_Tree_View_Record; 
  525.       Visible_Rect : out Gdk.Rectangle.Gdk_Rectangle); 
  526.    --  Fills Visible_Rect with the currently-visible region of the 
  527.    --  buffer, in tree coordinates. Convert to widget coordinates with 
  528.    --  gtk_tree_view_tree_to_widget_coords(). Tree coordinates start at 
  529.    --  0,0 for row 0 of the tree, and cover the entire scrollable area of 
  530.    --  the tree. 
  531.  
  532.    ------------------------ 
  533.    -- Coordinate Systems -- 
  534.    ------------------------ 
  535.  
  536.    --  Several different coordinate systems are exposed in the Gtk.Tree_View 
  537.    --  API. These are: 
  538.    --                   _____________________________ 
  539.    --               /   | _________________________ | 
  540.    --              /    | |                       | | 
  541.    --             /     | |     Header_Window     | | 
  542.    --             |     | |_______________________| | 
  543.    --             |     | _________________________ | 
  544.    --             |     | |  ...................  | |    \ 
  545.    --    widget- -+     | |  :                 :  | |     \ 
  546.    --  relative   |     | |  :   Bin_Window    :  | |      \ 
  547.    --             |     | |  :                 :  | |       \ 
  548.    --             |     | |  :                 :  | |       | 
  549.    --             \     | |  :                 :  | |       | 
  550.    --              \    | |__:_________________:__| |       +- tree 
  551.    --               \   |____:_________________:____|       |  coordinates 
  552.    --                        :                 :            | 
  553.    --                        :                 :            / 
  554.    --                        :                 :           / 
  555.    --                        :                 :          / 
  556.    --                        :.................:         / 
  557.    -- 
  558.    --  Widget coordinates ------ coordinates relative to the widget (usually 
  559.    --                            widget->window). 
  560.    -- 
  561.    --  Bin window coordinates -- coordinates relative to the window that 
  562.    --                            Gtk_Tree_View renders to. 
  563.    -- 
  564.    --  Tree coordinates -------- coordinates relative to the entire scrollable 
  565.    --                            area of Gtk_Tree_View. These coordinates start 
  566.    --                            at (0, 0) for row 0 of the tree. 
  567.    -- 
  568.    --  Several functions are available for converting between the different 
  569.    --  coordinate systems. The most common translations are between widget and 
  570.    --  bin window coordinates and between bin window and tree coordinates. For 
  571.    --  the former you can use Convert_Widget_To_Bin_Window_Coords (and vice 
  572.    --  versa), for the latter Convert_Bin_Window_To_Tree_Coords (and vice 
  573.    --  versa). 
  574.  
  575.    procedure Widget_To_Tree_Coords 
  576.      (Tree_View : access Gtk_Tree_View_Record; 
  577.       Wx        : Gint; 
  578.       Wy        : Gint; 
  579.       Tx        : out Gint; 
  580.       Ty        : out Gint); 
  581.    pragma Obsolescent; --  Widget_To_Tree_Coords 
  582.    --  Converts widget coordinates to coordinates for the 
  583.    --  tree window (the full scrollable area of the tree). 
  584.    -- 
  585.    --  Obsolescent; use Convert_Widget_To_Tree_Coords instead. 
  586.  
  587.    procedure Tree_To_Widget_Coords 
  588.      (Tree_View : access Gtk_Tree_View_Record; 
  589.       Tx        : Gint; 
  590.       Ty        : Gint; 
  591.       Wx        : out Gint; 
  592.       Wy        : out Gint); 
  593.    pragma Obsolescent; --  Tree_To_Widget_Coords 
  594.    --  Converts tree coordinates (coordinates in full scrollable area of 
  595.    --  the tree) to widget coordinates. 
  596.    -- 
  597.    --  Obsolescent; use Convert_Tree_To_Widget_Coords instead. 
  598.  
  599.    procedure Convert_Widget_To_Tree_Coords 
  600.      (Tree_View : access Gtk_Tree_View_Record; 
  601.       Wx        : Gint; 
  602.       Wy        : Gint; 
  603.       Tx        : out Gint; 
  604.       Ty        : out Gint); 
  605.    --  Converts widget coordinates to coordinates for the tree (the full 
  606.    --  scrollable area of the tree). 
  607.  
  608.    procedure Convert_Tree_To_Widget_Coords 
  609.      (Tree_View : access Gtk_Tree_View_Record; 
  610.       Tx        : Gint; 
  611.       Ty        : Gint; 
  612.       Wx        : out Gint; 
  613.       Wy        : out Gint); 
  614.    --  Converts tree coordinates (coordinates in full scrollable area of the 
  615.    --  tree) to widget coordinates. 
  616.  
  617.    procedure Convert_Bin_Window_To_Tree_Coords 
  618.      (Tree_View : access Gtk_Tree_View_Record; 
  619.       Bx        : Gint; 
  620.       By        : Gint; 
  621.       Tx        : out Gint; 
  622.       Ty        : out Gint); 
  623.    --  Converts bin_window coordinates to coordinates for the 
  624.    --  tree (the full scrollable area of the tree). 
  625.  
  626.    procedure Convert_Tree_To_Bin_Window_Coords 
  627.      (Tree_View : access Gtk_Tree_View_Record; 
  628.       Tx        : Gint; 
  629.       Ty        : Gint; 
  630.       Bx        : out Gint; 
  631.       By        : out Gint); 
  632.    --  Converts tree coordinates (coordinates in full scrollable area of the 
  633.    --  tree) to bin_window coordinates. 
  634.  
  635.    procedure Convert_Widget_To_Bin_Window_Coords 
  636.      (Tree_View : access Gtk_Tree_View_Record; 
  637.       Wx        : Gint; 
  638.       Wy        : Gint; 
  639.       Bx        : out Gint; 
  640.       By        : out Gint); 
  641.    --  Converts widget coordinates to coordinates for the Bin_Window 
  642.    --  (see Get_Bin_Window). 
  643.  
  644.    procedure Convert_Bin_Window_To_Widget_Coords 
  645.      (Tree_View : access Gtk_Tree_View_Record; 
  646.       Bx        : Gint; 
  647.       By        : Gint; 
  648.       Wx        : out Gint; 
  649.       Wy        : out Gint); 
  650.    --  Converts Bin_Window coordinates (see Get_Bin_Window) to widget 
  651.    --  relative coordinates. 
  652.  
  653.    --------------- 
  654.    -- Searching -- 
  655.    --------------- 
  656.  
  657.    procedure Set_Enable_Search 
  658.      (Tree_View     : access Gtk_Tree_View_Record; 
  659.       Enable_Search : Boolean); 
  660.    function Get_Enable_Search 
  661.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  662.    --  If enable_search is set, then the user can type in text to search 
  663.    --  through the tree interactively (this is sometimes called "typeahead 
  664.    --  find"). 
  665.    --  Note that even if this is FALSE, the user can still initiate a search 
  666.    --  using the "start-interactive-search" key binding. 
  667.  
  668.    procedure Set_Search_Column 
  669.      (Tree_View : access Gtk_Tree_View_Record; 
  670.       Column    : Gint); 
  671.    function Get_Search_Column 
  672.      (Tree_View : access Gtk_Tree_View_Record) return Gint; 
  673.    --  Sets column as the column where the interactive search code should 
  674.    --  search in. 
  675.    --  If the sort column is set, users can use the "start-interactive-search" 
  676.    --  key binding to bring up search popup. The enable-search property 
  677.    --  controls whether simply typing text will also start an interactive 
  678.    --  search. 
  679.    --  Note that column refers to a column of the model. 
  680.  
  681.    type Gtk_Tree_View_Search_Equal_Func is access 
  682.      function (Model  : System.Address; 
  683.                Column : Gint; 
  684.                Key    : Interfaces.C.Strings.chars_ptr; 
  685.                Iter   : Gtk.Tree_Model.Gtk_Tree_Iter; 
  686.                User_Data : System.Address) return Gboolean; 
  687.    pragma Convention (C, Gtk_Tree_View_Search_Equal_Func); 
  688.    --  The function used to compare for the interactive search capabilities. 
  689.    --  This function should return False on match, similar to C's strcmp(). 
  690.    --  This is a low-level function, and you should convert the model to a 
  691.    --  Gtk_Tree_Model (see Gtk_Tree_View_Row_Separator_Func 
  692.  
  693.    procedure Set_Search_Equal_Func 
  694.      (Tree_View         : access Gtk_Tree_View_Record; 
  695.       Search_Equal_Func : Gtk_Tree_View_Search_Equal_Func; 
  696.       Search_User_Data  : System.Address; 
  697.       Search_Destroy    : G_Destroy_Notify_Address := null); 
  698.    function Get_Search_Equal_Func 
  699.      (Tree_View : access Gtk_Tree_View_Record) 
  700.       return Gtk_Tree_View_Search_Equal_Func; 
  701.    --  Sets the compare function for the interactive search capabilities 
  702.  
  703.    function Get_Search_Entry 
  704.      (Tree_View : access Gtk_Tree_View_Record) return Gtk.GEntry.Gtk_Entry; 
  705.    procedure Set_Search_Entry 
  706.      (Tree_View : access Gtk_Tree_View_Record; 
  707.       The_Entry : access Gtk.GEntry.Gtk_Entry_Record'Class); 
  708.    --  Gets/Sets the entry which the interactive search code will use for this 
  709.    --  Tree_View.  This is useful when you want to provide a search entry 
  710.    --  in our interface at all time at a fixed position.  A null Gtk_Entry will 
  711.    --  make the interactive search code use the built-in popup entry again. 
  712.  
  713.    type Gtk_Tree_View_Search_Position_Func is access procedure 
  714.      (Tree_View     : System.Address;  --  Get_Object (Gtk_Tree_View_Record) 
  715.       Search_Dialog : System.Address;  --  Get_Object (Gtk_Widget'Class) 
  716.       User_Data     : System.Address); 
  717.    pragma Convention (C, Gtk_Tree_View_Search_Position_Func); 
  718.  
  719.    function Get_Search_Position_Func 
  720.      (Tree_View : access Gtk_Tree_View_Record) 
  721.       return Gtk_Tree_View_Search_Position_Func; 
  722.    procedure Set_Search_Position_Func 
  723.      (Tree_View : access Gtk_Tree_View_Record; 
  724.       Func      : Gtk_Tree_View_Search_Position_Func; 
  725.       Data      : System.Address; 
  726.       Destroy   : G_Destroy_Notify); 
  727.    --  Gets/Sets the function to use when positioning the search dialog. 
  728.  
  729.    -------------- 
  730.    -- Tooltips -- 
  731.    -------------- 
  732.  
  733.    procedure Set_Tooltip_Cell 
  734.      (Tree_View : access Gtk_Tree_View_Record; 
  735.       Tooltip   : access Gtk.Tooltip.Gtk_Tooltip_Record'Class; 
  736.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  737.       Column    : access 
  738.                   Gtk.Tree_View_Column.Gtk_Tree_View_Column_Record'Class; 
  739.       Cell      : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  740.    --  Sets the tip area of Tooltip to the area Path, Column and Cell have 
  741.    --  in common.  For example, if Path is null and Column is set, the tip 
  742.    --  area will be set to the full area covered by Column.  See also 
  743.    --  Gtk.Tooltip.Set_Tip_Area. 
  744.    -- 
  745.    --  Note that if Path is not specified and Cell is set and part of a column 
  746.    --  containing the expander, the tooltip might not show and hide at the 
  747.    --  correct position.  In such cases Path must be set to the current node 
  748.    --  under the mouse cursor for this function to operate correctly. 
  749.    -- 
  750.    --  See also Set_Tooltip_Column for a simpler alternative. 
  751.  
  752.    procedure Set_Tooltip_Column 
  753.      (Tree_View : access Gtk_Tree_View_Record; 
  754.       Column    : Gint); 
  755.    function Get_Tooltip_Column 
  756.      (Tree_View : access Gtk_Tree_View_Record) return Gint; 
  757.    --  If you only plan to have simple (text-only) tooltips on full rows, you 
  758.    --  can use this function to have Gtk_Tree_View handle these automatically 
  759.    --  for you. Column should be set to the column in tree_view's model 
  760.    --  containing the tooltip texts, or -1 to disable this feature. 
  761.    -- 
  762.    --  When enabled, "has-tooltip" will be set to TRUE and tree_view will 
  763.    --  connect a "query-tooltip" signal handler. 
  764.    -- 
  765.    --  Note that the signal handler sets the text with 
  766.    --  gtk_tooltip_set_markup(), so &, <, etc have to be escaped in the text. 
  767.  
  768.    procedure Get_Tooltip_Context 
  769.      (Tree_View     : access Gtk_Tree_View_Record; 
  770.       X             : in out Glib.Gint; 
  771.       Y             : in out Glib.Gint; 
  772.       Keyboard_Mode : Boolean; 
  773.       Model         : out Gtk.Tree_Model.Gtk_Tree_Model; 
  774.       Path          : out Gtk.Tree_Model.Gtk_Tree_Path; 
  775.       Iter          : out Gtk.Tree_Model.Gtk_Tree_Iter; 
  776.       Success       : out Boolean); 
  777.    --  This function is supposed to be used in a "query-tooltip" signal handler 
  778.    --  for Gtk_Tree_View. The x, y and keyboard_tip values which are received 
  779.    --  in the signal handler, should be passed to this function without 
  780.    --  modification. 
  781.    -- 
  782.    --  The Success indicates whether there is a tree view row at the given 
  783.    --  coordinates (True) or not (False) for mouse tooltips. For keyboard 
  784.    --  tooltips the row returned will be the cursor row. When True, then any of 
  785.    --  model, path and iter which have been provided will be set to point to 
  786.    --  that row and the corresponding model. x and y will always be converted 
  787.    --  to be relative to tree_view's bin_window if keyboard_tooltip is False. 
  788.  
  789.    procedure Set_Tooltip_Row 
  790.      (Tree_View : access Gtk_Tree_View_Record; 
  791.       Tooltip   : access Gtk.Tooltip.Gtk_Tooltip_Record'Class; 
  792.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  793.    --  Sets the tip area of tooltip to be the area covered by the row at path. 
  794.    --  See also Set_Tooltip_Column for a simpler alternative. See also 
  795.    --  Gtk.Tooltips.Set_Tip_Area. 
  796.  
  797.    ------------------------ 
  798.    -- Columns reordering -- 
  799.    ------------------------ 
  800.  
  801.    procedure Set_Reorderable 
  802.      (Tree_View   : access Gtk_Tree_View_Record; 
  803.       Reorderable : Boolean); 
  804.    function Get_Reorderable 
  805.      (Tree_View : access Gtk_Tree_View_Record) return Boolean; 
  806.    --  This function is a convenience function to allow you to reorder models 
  807.    --  that support the Gtk_Drag_Source_Iface and the Gtk_Drag_Dest_Iface. Both 
  808.    --  Gtk_Tree_Store and Gtk_List_Store support these. 
  809.    --  If Reorderable is True, then the user can reorder the model by dragging 
  810.    --  and dropping columns.  The developer can listen to these changes by 
  811.    --  connecting to the model's signals. 
  812.    --  This function does not give you any degree of control over the order 
  813.    --  - any reorderering is allowed. If more control is needed, you should 
  814.    --  probably handle drag and drop manually. 
  815.  
  816.    type Gtk_Tree_View_Column_Drop_Func is access 
  817.      function (Tree_View   : System.Address; --  Gtk_Tree_View 
  818.                Column      : System.Address; --  Gtk_Tree_View_Column 
  819.                Prev_Column : System.Address; --  Gtk_Tree_View_Column 
  820.                Next_Column : System.Address; --  Gtk_Tree_View_Column 
  821.                User_Data   : System.Address) return Gboolean; 
  822.    pragma Convention (C, Gtk_Tree_View_Column_Drop_Func); 
  823.    --  This function is used to determine whether a column may be dropped in 
  824.    --  a given location. 
  825.    --  This function is called on every column pair in turn at the beginning of 
  826.    --  a column drag to determine where a drop can take place. The arguments 
  827.    --  are: the tree_view, the column being dragged, the two columns 
  828.    --  determining the drop spot, and user_data. If either of the column 
  829.    --  arguments for the drop spot are null, then they indicate an edge. 
  830.    -- 
  831.    --  This is a low-level function, and you should use Get_User_Data to 
  832.    --  convert to the appropriate GtkAda widgets 
  833.  
  834.    procedure Set_Column_Drag_Function 
  835.      (Tree_View : access Gtk_Tree_View_Record; 
  836.       Func      : Gtk_Tree_View_Column_Drop_Func; 
  837.       User_Data : System.Address; 
  838.       Destroy   : Glib.G_Destroy_Notify_Address); 
  839.    --  Sets a user function for determining where a column may be dropped. 
  840.    --  If Func is set to be %NULL, then Tree_View reverts to the default 
  841.    --  behavior of allowing all columns to be dropped everywhere. 
  842.  
  843.    ------------------- 
  844.    -- Drag-and-drop -- 
  845.    ------------------- 
  846.  
  847.    procedure Enable_Model_Drag_Dest 
  848.      (Tree_View : access Gtk_Tree_View_Record; 
  849.       Targets   : Gtk.Selection.Target_Entry_Array; 
  850.       Actions   : Gdk.Dnd.Drag_Action); 
  851.    --  Turns Tree_View into a drop destination for automatic drag-and-drop. 
  852.    --  Targets is the table of targets that the drag will support. 
  853.    --  Actions is a bitmask of possible actions for a drag to this widget. 
  854.  
  855.    procedure Enable_Model_Drag_Source 
  856.      (Tree_View         : access Gtk_Tree_View_Record; 
  857.       Start_Button_Mask : Gdk.Types.Gdk_Modifier_Type; 
  858.       Targets           : Gtk.Selection.Target_Entry_Array; 
  859.       Actions           : Gdk.Dnd.Drag_Action); 
  860.    --  Turns Tree_View into a drag source for automatic DND. 
  861.    --  Targets is the list of targets that the drag will support. 
  862.    --  Actions is the bitmask of possible actions for a drag from this widget. 
  863.    --  Start_Button_Mask is the mask of allowed buttons to start the drag. 
  864.    --  You need to connect to the usual dnd signals (see gtk-dnd.ads) to 
  865.    --  provide the actual data upon request. 
  866.  
  867.    procedure Unset_Rows_Drag_Source (Tree_View : access Gtk_Tree_View_Record); 
  868.    --  Undoes the effect of Enable_Model_Drag_Source. 
  869.  
  870.    procedure Unset_Rows_Drag_Dest (Tree_View : access Gtk_Tree_View_Record); 
  871.    --  Undoes the effect of Enable_Model_Drag_Dest. 
  872.  
  873.    function Create_Row_Drag_Icon 
  874.      (Tree_View : access Gtk_Tree_View_Record; 
  875.       Path      : Gtk.Tree_Model.Gtk_Tree_Path) 
  876.       return Gdk.Pixmap.Gdk_Pixmap; 
  877.    --  Creates a Gdk_Pixmap representation of the row at path. This image is 
  878.    --  used for a drag icon. 
  879.    --  The returned pixmap must be freed by the user 
  880.  
  881.    procedure Get_Dest_Row_At_Pos 
  882.      (Tree_View : access Gtk_Tree_View_Record; 
  883.       Drag_X    : Gint; 
  884.       Drag_Y    : Gint; 
  885.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  886.       Pos       : out Gtk_Tree_View_Drop_Position; 
  887.       Success   : out Boolean); 
  888.    --  Determines the destination row for a given position. 
  889.    --  (Drag_X, Drag_Y) is the position to determine the destination row for. 
  890.  
  891.    procedure Set_Drag_Dest_Row 
  892.      (Tree_View : access Gtk_Tree_View_Record; 
  893.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  894.       Pos       : Gtk_Tree_View_Drop_Position); 
  895.    procedure Get_Drag_Dest_Row 
  896.      (Tree_View : access Gtk_Tree_View_Record; 
  897.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  898.       Pos       : out Gtk_Tree_View_Drop_Position); 
  899.    --  Sets or gets information about the row that is highlighted for feedback. 
  900.  
  901.    ---------------- 
  902.    -- Properties -- 
  903.    ---------------- 
  904.    --  The following properties are defined for this widget. See 
  905.    --  Glib.Properties for more information on properties. 
  906.  
  907.    --  <properties> 
  908.    --  Name:  Enable_Grid_Lines_Property 
  909.    --  Type:  Enum 
  910.    --  Descr: Whether grid lines should be drawn in the tree view 
  911.    -- 
  912.    --  Name:  Enable_Search_Property 
  913.    --  Type:  Boolean 
  914.    --  Descr: View allows user to search through columns interactively 
  915.    -- 
  916.    --  Name:  Enable_Tree_Lines_Property 
  917.    --  Type:  Boolean 
  918.    --  Descr: Whether tree lines should be drawn in the tree view 
  919.    -- 
  920.    --  Name:  Expander_Column_Property 
  921.    --  Type:  Object 
  922.    --  Descr: Set the column for the expander column 
  923.    -- 
  924.    --  Name:  Fixed_Height_Mode_Property 
  925.    --  Type:  Boolean 
  926.    --  Descr: Speeds up Gtk_Tree_View by assuming that all rows have the same 
  927.    --         height 
  928.    -- 
  929.    --  Name:  Hadjustment_Property 
  930.    --  Type:  Object 
  931.    --  Descr: Horizontal Adjustment for the widget 
  932.    -- 
  933.    --  Name:  Headers_Clickable_Property 
  934.    --  Type:  Boolean 
  935.    --  Descr: Column headers respond to click events 
  936.    -- 
  937.    --  Name:  Headers_Visible_Property 
  938.    --  Type:  Boolean 
  939.    --  Descr: Show the column header buttons 
  940.    -- 
  941.    --  Name:  Hover_Expand_Property 
  942.    --  Type:  Boolean 
  943.    --  Descr: Whether rows should be expanded/collapsed when the pointer moves 
  944.    --         over them 
  945.    -- 
  946.    --  Name:  Hover_Selection_Property 
  947.    --  Type:  Boolean 
  948.    --  Descr: Whether the selection should follow the pointer 
  949.    -- 
  950.    --  Name:  Level_Indentation_Property 
  951.    --  Type:  Int 
  952.    --  Descr: Extra indentation for each level 
  953.    -- 
  954.    --  Name:  Model_Property 
  955.    --  Type:  Object 
  956.    --  Descr: The model for the tree view 
  957.    -- 
  958.    --  Name:  Reorderable_Property 
  959.    --  Type:  Boolean 
  960.    --  Descr: View is reorderable 
  961.    -- 
  962.    --  Name:  Rubber_Banding_Property 
  963.    --  Type:  Boolean 
  964.    --  Descr: Whether to enable selection of multiple items by dragging the 
  965.    --         mouse pointer 
  966.    -- 
  967.    --  Name:  Rules_Hint_Property 
  968.    --  Type:  Boolean 
  969.    --  Descr: Set a hint to the theme engine to draw rows in alternating colors 
  970.    -- 
  971.    --  Name:  Search_Column_Property 
  972.    --  Type:  Int 
  973.    --  Descr: Model column to search through when searching through code 
  974.    -- 
  975.    --  Name:  Show_Expanders_Property 
  976.    --  Type:  Boolean 
  977.    --  Descr: View has expanders 
  978.    -- 
  979.    --  Name:  Tooltip_Column_Property 
  980.    --  Type:  Int 
  981.    --  Descr: The column in the model containing the tooltip texts for the rows 
  982.    -- 
  983.    --  Name:  Vadjustment_Property 
  984.    --  Type:  Object 
  985.    --  Descr: Vertical Adjustment for the widget 
  986.    --  </properties> 
  987.  
  988.    Enable_Grid_Lines_Property : constant Glib.Properties.Property_Enum; 
  989.    Enable_Search_Property     : constant Glib.Properties.Property_Boolean; 
  990.    Enable_Tree_Lines_Property : constant Glib.Properties.Property_Boolean; 
  991.    Expander_Column_Property   : constant Glib.Properties.Property_Object; 
  992.    Fixed_Height_Mode_Property : constant Glib.Properties.Property_Boolean; 
  993.    Hadjustment_Property       : constant Glib.Properties.Property_Object; 
  994.    Headers_Clickable_Property : constant Glib.Properties.Property_Boolean; 
  995.    Headers_Visible_Property   : constant Glib.Properties.Property_Boolean; 
  996.    Hover_Expand_Property      : constant Glib.Properties.Property_Boolean; 
  997.    Hover_Selection_Property   : constant Glib.Properties.Property_Boolean; 
  998.    Level_Indentation_Property : constant Glib.Properties.Property_Int; 
  999.    Model_Property             : constant Glib.Properties.Property_Object; 
  1000.    Reorderable_Property       : constant Glib.Properties.Property_Boolean; 
  1001.    Rubber_Banding_Property    : constant Glib.Properties.Property_Boolean; 
  1002.    Rules_Hint_Property        : constant Glib.Properties.Property_Boolean; 
  1003.    Search_Column_Property     : constant Glib.Properties.Property_Int; 
  1004.    Show_Expanders_Property    : constant Glib.Properties.Property_Boolean; 
  1005.    Tooltip_Column_Property    : constant Glib.Properties.Property_Int; 
  1006.    Vadjustment_Property       : constant Glib.Properties.Property_Object; 
  1007.  
  1008.    ---------------------- 
  1009.    -- Style Properties -- 
  1010.    ---------------------- 
  1011.    --  The following properties can be changed through the gtk theme and 
  1012.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  1013.  
  1014.    --  <style_properties> 
  1015.    --  Name:  Allow_Rules_Property 
  1016.    --  Type:  Boolean 
  1017.    --  Descr: Allow drawing of alternating color rows 
  1018.    -- 
  1019.    --  Name:  Even_Row_Color_Property 
  1020.    --  Type:  Boxed 
  1021.    --  Descr: Color to use for even rows 
  1022.    -- 
  1023.    --  Name:  Expander_Size_Property 
  1024.    --  Type:  Int 
  1025.    --  Descr: Size of the expander arrow 
  1026.    -- 
  1027.    --  Name:  Grid_Line_Pattern_Property 
  1028.    --  Type:  String 
  1029.    --  Descr: Dash pattern used to draw the tree view grid lines 
  1030.    -- 
  1031.    --  Name:  Grid_Line_Width_Property 
  1032.    --  Type:  Int 
  1033.    --  Descr: Width, in pixels, of the tree view grid lines 
  1034.    -- 
  1035.    --  Name:  Horizontal_Separator_Property 
  1036.    --  Type:  Int 
  1037.    --  Descr: Horizontal space between cells.  Must be an even number 
  1038.    -- 
  1039.    --  Name:  Indent_Expanders_Property 
  1040.    --  Type:  Boolean 
  1041.    --  Descr: Make the expanders indented 
  1042.    -- 
  1043.    --  Name:  Odd_Row_Color_Property 
  1044.    --  Type:  Boxed 
  1045.    --  Descr: Color to use for odd rows 
  1046.    -- 
  1047.    --  Name:  Row_Ending_Details_Property 
  1048.    --  Type:  Boolean 
  1049.    --  Descr: Enable extended row background theming 
  1050.    -- 
  1051.    --  Name:  Tree_Line_Pattern_Property 
  1052.    --  Type:  String 
  1053.    --  Descr: Dash pattern used to draw the tree view lines 
  1054.    -- 
  1055.    --  Name:  Tree_Line_Width_Property 
  1056.    --  Type:  Int 
  1057.    --  Descr: Width, in pixels, of the tree view lines 
  1058.    -- 
  1059.    --  Name:  Vertical_Separator_Property 
  1060.    --  Type:  Int 
  1061.    --  Descr: Vertical space between cells.  Must be an even number 
  1062.    --  </style_properties> 
  1063.  
  1064.    Allow_Rules_Property          : constant Glib.Properties.Property_Boolean; 
  1065.    --  Even_Row_Color_Property   : constant Glib.Properties.Property_Boxed; 
  1066.    Expander_Size_Property        : constant Glib.Properties.Property_Int; 
  1067.    Grid_Line_Pattern_Property    : constant Glib.Properties.Property_String; 
  1068.    Grid_Line_Width_Property      : constant Glib.Properties.Property_Int; 
  1069.    Horizontal_Separator_Property : constant Glib.Properties.Property_Int; 
  1070.    Indent_Expanders_Property     : constant Glib.Properties.Property_Boolean; 
  1071.    --  Odd_Row_Color_Property    : constant Glib.Properties.Property_Boxed; 
  1072.    Row_Ending_Details_Property   : constant Glib.Properties.Property_Boolean; 
  1073.    Tree_Line_Pattern_Property    : constant Glib.Properties.Property_String; 
  1074.    Tree_Line_Width_Property      : constant Glib.Properties.Property_Int; 
  1075.    Vertical_Separator_Property   : constant Glib.Properties.Property_Int; 
  1076.  
  1077.    ------------- 
  1078.    -- Signals -- 
  1079.    ------------- 
  1080.  
  1081.    --  <signals> 
  1082.    --  The following new signals are defined for this widget: 
  1083.    -- 
  1084.    --  - "set_scroll_adjustments" 
  1085.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1086.    --       Hadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class; 
  1087.    --       Vadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  1088.    -- 
  1089.    --  - "row_activated" 
  1090.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1091.    --       Path : Gtk.Tree_Model.Gtk_Tree_Path; 
  1092.    --       Column : Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  1093.    -- 
  1094.    --  - "test_expand_row" 
  1095.    --    function Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1096.    --       Iter : access Gtk.Tree_Iter.Gtk_Tree_Iter_Record'Class; 
  1097.    --       Path : Gtk.Tree_Model.Gtk_Tree_Path) 
  1098.    --       return Gboolean; 
  1099.    -- 
  1100.    --  - "test_collapse_row" 
  1101.    --    function Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1102.    --       Iter : access Gtk.Tree_Iter.Gtk_Tree_Iter_Record'Class; 
  1103.    --       Path : Gtk.Tree_Model.Gtk_Tree_Path) 
  1104.    --       return Gboolean; 
  1105.    -- 
  1106.    --  - "row_expanded" 
  1107.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1108.    --       Iter : access Gtk.Tree_Iter.Gtk_Tree_Iter_Record'Class; 
  1109.    --       Path : Gtk.Tree_Model.Gtk_Tree_Path); 
  1110.    -- 
  1111.    --  - "row_collapsed" 
  1112.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1113.    --       Iter : access Gtk.Tree_Iter.Gtk_Tree_Iter_Record'Class; 
  1114.    --       Path : Gtk.Tree_Model.Gtk_Tree_Path); 
  1115.    -- 
  1116.    --  - "columns_changed" 
  1117.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class); 
  1118.    -- 
  1119.    --  - "move_cursor" 
  1120.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1121.    --       Step : Gtk_Movement_Step; 
  1122.    --       Count : Gint); 
  1123.    -- 
  1124.    --  - "select_all" 
  1125.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class); 
  1126.    -- 
  1127.    --  - "select_cursor_row" 
  1128.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1129.    --       Start_Editing : Boolean); 
  1130.    -- 
  1131.    --  - "toggle_cursor_row" 
  1132.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class); 
  1133.    -- 
  1134.    --  - "expand_collapse_cursor_row" 
  1135.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class; 
  1136.    --       Logical : Boolean; 
  1137.    --       Expand : Boolean; 
  1138.    --       Open_All : Boolean); 
  1139.    -- 
  1140.    --  - "select_cursor_parent" 
  1141.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class); 
  1142.    -- 
  1143.    --  - "start_interactive_search" 
  1144.    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class); 
  1145.    -- 
  1146.    --  </signals> 
  1147.  
  1148.    Signal_Columns_Changed            : constant Glib.Signal_Name := 
  1149.                                          "columns_changed"; 
  1150.    Signal_Cursor_Changed             : constant Glib.Signal_Name := 
  1151.                                          "cursor_changed"; 
  1152.    Signal_Expand_Collapse_Cursor_Row : constant Glib.Signal_Name := 
  1153.                                          "expand_collapse_cursor_row"; 
  1154.    Signal_Move_Cursor                : constant Glib.Signal_Name := 
  1155.                                          "move_cursor"; 
  1156.    Signal_Row_Activated              : constant Glib.Signal_Name := 
  1157.                                          "row_activated"; 
  1158.    Signal_Row_Collapsed              : constant Glib.Signal_Name := 
  1159.                                          "row_collapsed"; 
  1160.    Signal_Row_Expanded               : constant Glib.Signal_Name := 
  1161.                                          "row_expanded"; 
  1162.    Signal_Select_All                 : constant Glib.Signal_Name := 
  1163.                                          "select_all"; 
  1164.    Signal_Select_Cursor_Parent       : constant Glib.Signal_Name := 
  1165.                                          "select_cursor_parent"; 
  1166.    Signal_Select_Cursor_Row          : constant Glib.Signal_Name := 
  1167.                                          "select_cursor_row"; 
  1168.    Signal_Set_Scroll_Adjustments     : constant Glib.Signal_Name := 
  1169.                                          "set_scroll_adjustments"; 
  1170.    Signal_Start_Interactive_Search   : constant Glib.Signal_Name := 
  1171.                                          "start_interactive_search"; 
  1172.    Signal_Test_Collapse_Row          : constant Glib.Signal_Name := 
  1173.                                          "test_collapse_row"; 
  1174.    Signal_Test_Expand_Row            : constant Glib.Signal_Name := 
  1175.                                          "test_expand_row"; 
  1176.    Signal_Toggle_Cursor_Row          : constant Glib.Signal_Name := 
  1177.                                          "toggle_cursor_row"; 
  1178.    Signal_Unselect_All               : constant Glib.Signal_Name := 
  1179.                                          "unselect_all"; 
  1180.  
  1181. private 
  1182.    type Gtk_Tree_View_Record is 
  1183.      new Gtk.Container.Gtk_Container_Record with null record; 
  1184.  
  1185.    Enable_Grid_Lines_Property : constant Glib.Properties.Property_Enum := 
  1186.      Glib.Properties.Build ("enable-grid-lines"); 
  1187.    Enable_Search_Property : constant Glib.Properties.Property_Boolean := 
  1188.      Glib.Properties.Build ("enable-search"); 
  1189.    Enable_Tree_Lines_Property : constant Glib.Properties.Property_Boolean := 
  1190.      Glib.Properties.Build ("enable-tree-lines"); 
  1191.    Expander_Column_Property : constant Glib.Properties.Property_Object := 
  1192.      Glib.Properties.Build ("expander-column"); 
  1193.    Fixed_Height_Mode_Property : constant Glib.Properties.Property_Boolean := 
  1194.      Glib.Properties.Build ("fixed-height-mode"); 
  1195.    Hadjustment_Property : constant Glib.Properties.Property_Object := 
  1196.      Glib.Properties.Build ("hadjustment"); 
  1197.    Headers_Clickable_Property : constant Glib.Properties.Property_Boolean := 
  1198.      Glib.Properties.Build ("headers-clickable"); 
  1199.    Headers_Visible_Property : constant Glib.Properties.Property_Boolean := 
  1200.      Glib.Properties.Build ("headers-visible"); 
  1201.    Hover_Expand_Property : constant Glib.Properties.Property_Boolean := 
  1202.      Glib.Properties.Build ("hover-expand"); 
  1203.    Hover_Selection_Property : constant Glib.Properties.Property_Boolean := 
  1204.      Glib.Properties.Build ("hover-selection"); 
  1205.    Level_Indentation_Property : constant Glib.Properties.Property_Int := 
  1206.      Glib.Properties.Build ("level-indentation"); 
  1207.    Model_Property : constant Glib.Properties.Property_Object := 
  1208.      Glib.Properties.Build ("model"); 
  1209.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  1210.      Glib.Properties.Build ("reorderable"); 
  1211.    Rubber_Banding_Property : constant Glib.Properties.Property_Boolean := 
  1212.      Glib.Properties.Build ("rubber-banding"); 
  1213.    Rules_Hint_Property : constant Glib.Properties.Property_Boolean := 
  1214.      Glib.Properties.Build ("rules-hint"); 
  1215.    Search_Column_Property : constant Glib.Properties.Property_Int := 
  1216.      Glib.Properties.Build ("search-column"); 
  1217.    Show_Expanders_Property : constant Glib.Properties.Property_Boolean := 
  1218.      Glib.Properties.Build ("show-expanders"); 
  1219.    Tooltip_Column_Property : constant Glib.Properties.Property_Int := 
  1220.      Glib.Properties.Build ("tooltip-column"); 
  1221.    Vadjustment_Property : constant Glib.Properties.Property_Object := 
  1222.      Glib.Properties.Build ("vadjustment"); 
  1223.  
  1224.    Allow_Rules_Property : constant Glib.Properties.Property_Boolean := 
  1225.      Glib.Properties.Build ("allow-rules"); 
  1226. --     Even_Row_Color_Property : constant Glib.Properties.Property_Boxed := 
  1227. --       Glib.Properties.Build ("even-row-color"); 
  1228.    Expander_Size_Property : constant Glib.Properties.Property_Int := 
  1229.      Glib.Properties.Build ("expander-size"); 
  1230.    Grid_Line_Pattern_Property : constant Glib.Properties.Property_String := 
  1231.      Glib.Properties.Build ("grid-line-pattern"); 
  1232.    Grid_Line_Width_Property : constant Glib.Properties.Property_Int := 
  1233.      Glib.Properties.Build ("grid-line-width"); 
  1234.    Horizontal_Separator_Property : constant Glib.Properties.Property_Int := 
  1235.      Glib.Properties.Build ("horizontal-separator"); 
  1236.    Indent_Expanders_Property : constant Glib.Properties.Property_Boolean := 
  1237.      Glib.Properties.Build ("indent-expanders"); 
  1238. --     Odd_Row_Color_Property : constant Glib.Properties.Property_Boxed := 
  1239. --       Glib.Properties.Build ("odd-row-color"); 
  1240.    Row_Ending_Details_Property : constant Glib.Properties.Property_Boolean := 
  1241.      Glib.Properties.Build ("row-ending-details"); 
  1242.    Tree_Line_Pattern_Property : constant Glib.Properties.Property_String := 
  1243.      Glib.Properties.Build ("tree-line-pattern"); 
  1244.    Tree_Line_Width_Property : constant Glib.Properties.Property_Int := 
  1245.      Glib.Properties.Build ("tree-line-width"); 
  1246.    Vertical_Separator_Property : constant Glib.Properties.Property_Int := 
  1247.      Glib.Properties.Build ("vertical-separator"); 
  1248.  
  1249.    pragma Import (C, Get_Type, "gtk_tree_view_get_type"); 
  1250. end Gtk.Tree_View; 
  1251.  
  1252. --  No binding: gtk_tree_view_set_destroy_count_func 
  1253. --  No binding: gtk_tree_view_insert_column_with_attributes