This widget is deprecated. Use Gtk.Tree_View instead.
This widget is similar to Gtk_Clist but it displays a tree with expandable nodes instead of a simple list. Gtk_Tree is a more flexible tree widget (it can have arbitrary widgets in the tree cells), but it is less efficient and is limited to 32768 pixels.
If you need horizontal or vertical scrolling, you mustn't put this widget in a Gtk_Viewport, and then in a Gtk_Scrolled_Window. Put it directly into a Gtk_Scrolled_Window, or horizontal scrolling will be disabled, and the column headers will disappear when scrolling vertically.
Widget Hierarchy |
---|
GObject (see section Package Glib.Object) Gtk_Object (see section Package Gtk.Object) \___ Gtk_Widget (see section Package Gtk.Widget) \___ Gtk_Container (see section Package Gtk.Container) \___ Gtk_Clist (see section Package Gtk.Clist) \___ Gtk_Ctree (see section Package Gtk.Ctree) |
Signals |
---|
Types |
---|
type Gcompare_Func is access function (A, B : in Data_Type) return Boolean; | |
Function used to compare data types in the functions
Find_[All] By_Row_Data_Custom.
| |
type Gtk_Ctree_Compare_Drag_Func is access function (Ctree : in Gtk_Ctree; Source_Node : in Gtk_Ctree_Node; New_Parent : in Gtk_Ctree_Node; New_Sibling : in Gtk_Ctree_Node) return Boolean; | |
Function type used in Set_Drag_Compare_Func.
| |
type Gtk_Ctree_Func is access procedure (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type_Access); | |
Function used by Post/Pre_Recursive functions below.
| |
type Gtk_Ctree_Node is new Gdk.C_Proxy; | |
This type represents a node inside a Ctree.
| |
type Gtk_Ctree_Row is new Gtk.Clist.Gtk_Clist_Row; | |
Similar to Clist_Row, but for a Ctree.
|
Subprograms |
---|
Creation, insertion, deletion | ||
Elements inside a Gtk_Ctree are not ordered from the top to the bottom | ||
procedure Gtk_New (Widget : out Gtk_Ctree; Columns : in Gint; Tree_Column : in Gint := 0); | ||
Create a ctree with Columns columns. | ||
procedure Gtk_New (Widget : out Gtk_Ctree; Titles : in Chars_Ptr_Array; Tree_Column : in Gint := 0); | ||
Create a ctree with Titles'Length columns. | ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Ctree.
| ||
function Insert_Node (Ctree : access Gtk_Ctree_Record; Parent : in Gtk_Ctree_Node; Sibling : in Gtk_Ctree_Node; Text : in Chars_Ptr_Array; Spacing : in Guint8; Pixmap_Closed : in Gdk.Pixmap.Gdk_Pixmap; Mask_Closed : in Gdk.Bitmap.Gdk_Bitmap; Pixmap_Opened : in Gdk.Pixmap.Gdk_Pixmap; Mask_Opened : in Gdk.Bitmap.Gdk_Bitmap; Is_Leaf : in Boolean; Expanded : in Boolean) return Gtk_Ctree_Node; | ||
Insert a new node in the Ctree. | ||
procedure Remove_Node (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Remove Node from Ctree.
| ||
Tree, Node and Row basic manipulation | ||
function Get_Tree_Column (Widget : access Gtk.Ctree.Gtk_Ctree_Record'Class) return Gint; | ||
Return the Tree_Column attribute of a given Node. | ||
function Get_Node_List (Ctree : access Gtk_Ctree_Record) return Node_List.Glist; | ||
Return the list of nodes associated with a given Ctree. | ||
function Get_Row_List (Ctree : access Gtk_Ctree_Record) return Row_List.Glist; | ||
Return the list of rows associated with a given Ctree.
| ||
function Get_Selection (Ctree : access Gtk_Ctree_Record) return Node_List.Glist; | ||
Return the list of nodes currently selected. | ||
function Node_Get_Row (Node : in Gtk_Ctree_Node) return Gtk_Ctree_Row; | ||
Return the row of a given Node.
| ||
function Row_Get_Children (Row : in Gtk_Ctree_Row) return Gtk_Ctree_Node; | ||
Return the children node of a given Row.
| ||
function Row_Get_Expanded (Row : in Gtk_Ctree_Row) return Boolean; | ||
Return the expanded attribute of a given Row. | ||
function Row_Get_Is_Leaf (Row : in Gtk_Ctree_Row) return Boolean; | ||
Return the leaf attribute of a given Row. | ||
function Row_Get_Parent (Row : in Gtk_Ctree_Row) return Gtk_Ctree_Node; | ||
Return the parent node of a given Row.
| ||
function Row_Get_Sibling (Row : in Gtk_Ctree_Row) return Gtk_Ctree_Node; | ||
Return the sibling node of a given Row.
| ||
function Is_Created (Node : in Gtk_Ctree_Node) return Boolean; | ||
Return True if Node is different from Null_Ctree_Node
| ||
Querying / finding tree information | ||
function Is_Viewable (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node) return Boolean; | ||
Return True if Node is viewable. | ||
function Last (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node) return Gtk_Ctree_Node; | ||
Return the last node of a given subtree. | ||
function Find_Node_Ptr (Ctree : access Gtk_Ctree_Record; Ctree_Row : in Gtk_Ctree_Row) return Gtk_Ctree_Node; | ||
Return the node corresponding to a given row.
| ||
function Node_Nth (Ctree : access Gtk_Ctree_Record; Row : in Guint) return Gtk_Ctree_Node; | ||
Return the Node corresponding to the nth row of a given Ctree. | ||
function Find (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Child : in Gtk_Ctree_Node) return Boolean; | ||
Recursively search for a given Child in a given subtree. | ||
function Is_Ancestor (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Child : in Gtk_Ctree_Node) return Boolean; | ||
Indicate whether Node is an ancestor of Child. | ||
function Is_Hot_Spot (Ctree : access Gtk_Ctree_Record; X : in Gint; Y : in Gint) return Boolean; | ||
Return True if the Ctree is centered on (x,y)
| ||
Tree signals: move, expand, collapse, (un)select | ||
procedure Move (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; New_Parent : in Gtk_Ctree_Node; New_Sibling : in Gtk_Ctree_Node); | ||
Move a node in a Ctree. | ||
procedure Expand (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Expand the first level of the subtree associated with Node.
| ||
procedure Expand_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null); | ||
Expand the whole subtree associated with Node.
| ||
procedure Expand_To_Depth (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null; Depth : in Gint); | ||
Expand the subtree associated with Node and its descendants until Depth | ||
procedure Collapse (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Collapse the first level of the subtree associated with Node.
| ||
procedure Collapse_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null); | ||
Collapse the whole subtree associated with Node.
| ||
procedure Collapse_To_Depth (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null; Depth : in Gint); | ||
Collapse the subtree associated with Node and its descendants until | ||
procedure Toggle_Expansion (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Change the state of the Ctree from expanded to collapsed and the other | ||
procedure Toggle_Expansion_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Change the state of the Ctree from expanded to collapsed and the other | ||
procedure Gtk_Select (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Select a specified Node, and only this one.
| ||
procedure Select_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null); | ||
Select a specified Node, and its whole subtree.
| ||
procedure Unselect (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Unselect a specified Node, and only this one.
| ||
procedure Unselect_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null); | ||
Unselect a specified Node, and its whole subtree.
| ||
procedure Real_Select_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null; Do_Select : in Boolean); | ||
Similar to Select_Recursive or Unselect_Recursive. | ||
Analogs of Gtk_Clist functions | ||
procedure Node_Set_Text (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Text : in UTF8_String); | ||
Set the cell's text, replacing its current contents. | ||
function Node_Get_Text (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint) return UTF8_String; | ||
Return the text contained in cell. | ||
procedure Node_Set_Pixmap (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Pixmap : in Gdk.Pixmap.Gdk_Pixmap; Mask : in Gdk.Bitmap.Gdk_Bitmap); | ||
Set the cell's pixmap, replacing its current contents. | ||
procedure Node_Get_Pixmap (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Pixmap : out Gdk.Pixmap.Gdk_Pixmap; Mask : out Gdk.Bitmap.Gdk_Bitmap; Success : out Boolean); | ||
Return the Pixmap contained in a cell. | ||
procedure Node_Set_Pixtext (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Text : in UTF8_String; Spacing : in Guint8; Pixmap : in Gdk.Pixmap.Gdk_Pixmap; Mask : in Gdk.Bitmap.Gdk_Bitmap); | ||
Set both the Text and the Pixmap for the cell. | ||
procedure Node_Get_Pixtext (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Text : out Interfaces.C.Strings.chars_ptr; Spacing : out Guint8; Pixmap : out Gdk.Pixmap.Gdk_Pixmap; Mask : out Gdk.Bitmap.Gdk_Bitmap; Success : out Boolean); | ||
Return the Text and the Pixmap for the cell. | ||
procedure Node_Set_Shift (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Vertical : in Gint; Horizontal : in Gint); | ||
Set a horizontal and vertical shift for drawing the content of the cell. | ||
procedure Set_Node_Info (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Text : in UTF8_String; Spacing : in Guint8; Pixmap_Closed : in Gdk.Pixmap.Gdk_Pixmap; Mask_Closed : in Gdk.Bitmap.Gdk_Bitmap; Pixmap_Opened : in Gdk.Pixmap.Gdk_Pixmap; Mask_Opened : in Gdk.Bitmap.Gdk_Bitmap; Is_Leaf : in Boolean; Expanded : in Boolean); | ||
Set all the info related to a specific Node.
| ||
procedure Get_Node_Info (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Text : out Interfaces.C.Strings.chars_ptr; Spacing : out Guint8; Pixmap_Closed : out Gdk.Pixmap.Gdk_Pixmap; Mask_Closed : out Gdk.Bitmap.Gdk_Bitmap; Pixmap_Opened : out Gdk.Pixmap.Gdk_Pixmap; Mask_Opened : out Gdk.Bitmap.Gdk_Bitmap; Is_Leaf : out Boolean; Expanded : out Boolean; Success : out Boolean); | ||
Return all the info related to a specific Node.
| ||
procedure Node_Set_Selectable (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Selectable : in Boolean := True); | ||
Indicate whether the Node can be selected or not. | ||
function Node_Get_Selectable (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node) return Boolean; | ||
Return the selectable status of the Node.
| ||
procedure Node_Set_Row_Style (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Style : in Gtk.Style.Gtk_Style); | ||
Set the default style for the cells in the Node. | ||
function Node_Get_Row_Style (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node) return Gtk.Style.Gtk_Style; | ||
Return the default style used for the Node.
| ||
procedure Node_Set_Cell_Style (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Style : in Gtk.Style.Gtk_Style); | ||
Set the style (font, color, ...) used for the cell. | ||
function Node_Get_Cell_Style (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint) return Gtk.Style.Gtk_Style; | ||
Return the style of the cell.
| ||
procedure Node_Set_Foreground (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Color : in Gdk.Color.Gdk_Color); | ||
Set the foreground color for the Node. | ||
procedure Node_Set_Background (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Color : in Gdk.Color.Gdk_Color); | ||
Set the background color for the Node. | ||
function Node_Get_Cell_Type (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint) return Gtk.Clist.Gtk_Cell_Type; | ||
Return the type of the cell at Node/Column. | ||
procedure Node_Moveto (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node; Column : in Gint; Row_Align : in Gfloat := 0.5; Col_Align : in Gfloat := 0.5); | ||
Make a Node visible. | ||
function Node_Is_Visible (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node) return Gtk_Visibility; | ||
Indicate the visibility of a Node. | ||
Ctree specific functions | ||
procedure Set_Indent (Ctree : access Gtk_Ctree_Record; Indent : in Gint := 20); | ||
Change the indentation of the Ctree. | ||
function Get_Indent (Widget : access Gtk.Ctree.Gtk_Ctree_Record'Class) return Gint; | ||
Return the indentation of a Ctree.
| ||
procedure Set_Spacing (Ctree : access Gtk_Ctree_Record; Spacing : in Gint := 5); | ||
Set the spacing between the tree's icon and the additional pixmap. | ||
function Get_Spacing (Widget : access Gtk.Ctree.Gtk_Ctree_Record'Class) return Gint; | ||
Return the spacing between the tree's icon and the additional pixmap.
| ||
procedure Set_Show_Stub (Ctree : access Gtk_Ctree_Record; Show_Stub : in Boolean); | ||
Set the Show_Stub attribute of Ctree.
| ||
function Get_Show_Stub (Ctree : access Gtk_Ctree_Record) return Boolean; | ||
Return the Show_Stub attribute of Ctree.
| ||
procedure Set_Line_Style (Ctree : access Gtk_Ctree_Record; Line_Style : in Gtk_Ctree_Line_Style := Ctree_Lines_Solid); | ||
Change the style of the lines representing the tree of a given Ctree. | ||
function Get_Line_Style (Ctree : access Gtk_Ctree_Record) return Gtk_Ctree_Line_Style; | ||
return the style of the lines representing the tree of a given Ctree.
| ||
procedure Set_Expander_Style (Ctree : access Gtk_Ctree_Record; Expander_Style : in Gtk_Ctree_Expander_Style := Ctree_Expander_Square); | ||
Set the way a given Ctree can be expanded. | ||
function Get_Expander_Style (Ctree : access Gtk_Ctree_Record) return Gtk_Ctree_Expander_Style; | ||
Return the way a given Ctree can be expanded.
| ||
procedure Set_Drag_Compare_Func (Ctree : access Gtk_Ctree_Record; Cmp_Func : in Gtk_Ctree_Compare_Drag_Func); | ||
Set the drag compare function of a given Ctree. | ||
Tree sorting functions | ||
procedure Sort_Node (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node); | ||
Sort the nodes of a given Ctree. | ||
procedure Sort_Recursive (Ctree : access Gtk_Ctree_Record; Node : in Gtk_Ctree_Node := null); | ||
Sort the nodes of a given Ctree recursively. | ||
Row_Data handling | ||
procedure Node_Set_Row_Data (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type); | ||
Associate a Data with a Node.
| ||
function Node_Get_Row_Data (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node) return Data_Type; | ||
Retrieve a data associated with a Node. | ||
function Find_By_Row_Data (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type) return Gtk_Ctree_Node; | ||
Find the first node containing a specified Data. | ||
function Find_All_By_Row_Data (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type) return Node_List.Glist; | ||
Find all nodes containing a specified Data. | ||
function Find_By_Row_Data_Custom (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type; Func : in Gcompare_Func) return Gtk_Ctree_Node; | ||
Find the first node containing a specified Data. | ||
function Find_All_By_Row_Data_Custom (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Data : in Data_Type; Func : in Gcompare_Func) return Node_List.Glist; | ||
Find all the nodes containing a specified Data. | ||
procedure Post_Recursive (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Func : in Gtk_Ctree_Func; Data : in Data_Type_Access); | ||
Apply Func to each node of a subtree. | ||
procedure Post_Recursive_To_Depth (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Depth : in Gint; Func : in Gtk_Ctree_Func; Data : in Data_Type_Access); | ||
Apply Func to each node of a subtree until a specified Depth. | ||
procedure Pre_Recursive (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Func : in Gtk_Ctree_Func; Data : in Data_Type_Access); | ||
Apply Func to each node of a subtree. | ||
procedure Pre_Recursive_To_Depth (Ctree : access Gtk_Ctree_Record'Class; Node : in Gtk_Ctree_Node; Depth : in Gint; Func : in Gtk_Ctree_Func; Data : in Data_Type_Access); | ||
Apply Func to each node of a subtree until a specific Depth. |