## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Text

- Goto spec source

# Description

    package Gtk.Text is

This widget displays any given text that can be manipulated by both the user and the programmer.

The text can optionally be interactively modified by the user.

Different colors and fonts can be used for any given part of the text. The background can have any color, or even be a pixmap.

Binding from C File version 2.8.17

# Classes

### Gtk_Text_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Text_Record is new
         Gtk.Old_Editable.Gtk_Old_Editable_Record with private;

#### Ancestors:

Gtk.Old_Editable.Gtk_Old_Editable_Record
Gtk.Widget.Gtk_Widget_Record
Glib.Object.GObject_Record

#### Primitive operations:

Backward_Delete

- To API doc
- To spec

Forward_Delete

- To API doc
- To spec

Freeze

- To API doc
- To spec

Get_Gap_Position

- To API doc
- To spec

Get_Gap_Size

- To API doc
- To spec

Get_Hadj

- To API doc
- To spec

Get_Length

- To API doc
- To spec

Get_Point

- To API doc
- To spec

Get_Text

- To API doc
- To spec

Get_Text_Area

- To API doc
- To spec

Get_Text_End

- To API doc
- To spec

Get_Vadj

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Changed

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Claim_Selection

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Copy_Clipboard

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Cut_Clipboard

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Delete_Selection

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Delete_Text

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Chars

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Clipboard_Text

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Editable

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Has_Selection

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Position

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Selection_End_Pos

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Get_Selection_Start_Pos

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Insert_Text

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Paste_Clipboard

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Select_Region

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Set_Editable

- To API doc
- To spec

(Inherited)
Gtk.Old_Editable.Set_Position

- To API doc
- To spec

(Inherited)
Gtk.Widget.Activate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Accelerator

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Add_Mnemonic_Label

- To API doc
- To spec

(Inherited)
Gtk.Widget.Can_Activate_Accel

- To API doc
- To spec

(Inherited)
Gtk.Widget.Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Class_Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Class_Path_Reversed

- To API doc
- To spec

(Inherited)
Gtk.Widget.Create_Pango_Context

- To API doc
- To spec

(Inherited)
Gtk.Widget.Create_Pango_Layout

- To API doc
- To spec

(Inherited)
Gtk.Widget.Destroy

- To API doc
- To spec

(Inherited)
Gtk.Widget.Draw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Ensure_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Error_Bell

- To API doc
- To spec

(Inherited)
Gtk.Widget.Flag_Is_Set

- To API doc
- To spec

(Inherited)
Gtk.Widget.Flags

- To API doc
- To spec

(Inherited)
Gtk.Widget.Freeze_Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Height

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Width

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_X

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Allocation_Y

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Ancestor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Child_Requisition

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Child_Visible

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Colormap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Composite_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Direction

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Extension_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Has_Tooltip

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_No_Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Pango_Context

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Parent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Parent_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Pointer

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Root_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Snapshot

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_State

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Markup

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Tooltip_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Toplevel

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Visual

- To API doc
- To spec

(Inherited)
Gtk.Widget.Get_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Grab_Default

- To API doc
- To spec

(Inherited)
Gtk.Widget.Grab_Focus

- To API doc
- To spec

(Inherited)
Gtk.Widget.Has_Screen

- To API doc
- To spec

(Inherited)
Gtk.Widget.Hide

- To API doc
- To spec

(Inherited)
Gtk.Widget.Hide_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Input_Shape_Combine_Mask

- To API doc
- To spec

(Inherited)
Gtk.Widget.Intersect

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Ancestor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Composited

- To API doc
- To spec

(Inherited)
Gtk.Widget.Is_Focus

- To API doc
- To spec

(Inherited)
Gtk.Widget.Keynav_Failed

- To API doc
- To spec

(Inherited)
Gtk.Widget.List_Mnemonic_Labels

- To API doc
- To spec

(Inherited)
Gtk.Widget.Map

- To API doc
- To spec

(Inherited)
Gtk.Widget.Mnemonic_Activate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Base

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Bg

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Cursor

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Fg

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Font

- To API doc
- To spec

(Inherited)
Gtk.Widget.Modify_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Path_Reversed

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Clear

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Clear_Area

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Draw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Draw_Area

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Resize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Queue_Resize_No_Redraw

- To API doc
- To spec

(Inherited)
Gtk.Widget.Realize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Region_Intersect

- To API doc
- To spec

(Inherited)
Gtk.Widget.Remove_Accelerator

- To API doc
- To spec

(Inherited)
Gtk.Widget.Remove_Mnemonic_Label

- To API doc
- To spec

(Inherited)
Gtk.Widget.Render_Icon

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reparent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reset_Rc_Styles

- To API doc
- To spec

(Inherited)
Gtk.Widget.Reset_Shapes

- To API doc
- To spec

(Inherited)
Gtk.Widget.Restore_Default_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Send_Expose

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Accel_Path

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_App_Paintable

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Child_Visible

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Colormap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Composite_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Direction

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Double_Buffered

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Extension_Events

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Flags

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Has_Tooltip

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Name

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_No_Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Parent

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Parent_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Redraw_On_Allocate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Scroll_Adjustments

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Sensitive

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_State

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Style

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Markup

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Text

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Tooltip_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_UPosition

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_USize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Set_Window

- To API doc
- To spec

(Inherited)
Gtk.Widget.Shape_Combine_Mask

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show_All

- To API doc
- To spec

(Inherited)
Gtk.Widget.Show_Now

- To API doc
- To spec

(Inherited)
Gtk.Widget.Size_Allocate

- To API doc
- To spec

(Inherited)
Gtk.Widget.Size_Request

- To API doc
- To spec

(Inherited)
Gtk.Widget.Style_Get_Property

- To API doc
- To spec

(Inherited)
Gtk.Widget.Thaw_Child_Notify

- To API doc
- To spec

(Inherited)
Gtk.Widget.Trigger_Tooltip_Query

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unmap

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unrealize

- To API doc
- To spec

(Inherited)
Gtk.Widget.Unset_Flags

- To API doc
- To spec

(Inherited)
Insert

- To API doc
- To spec

Set_Adjustments

- To API doc
- To spec

Set_Editable

- To API doc
- To spec

Set_Line_Wrap

- To API doc
- To spec

Set_Point

- To API doc
- To spec

Set_Word_Wrap

- To API doc
- To spec

Thaw

- To API doc
- To spec

# Types

### Gtk_Text

- Goto declaration in source

    type Gtk_Text is access all Gtk_Text_Record'Class;

# Constants & Global variables

### Signal_Set_Scroll_Adjustments

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Set_Scroll_Adjustments : constant Glib.Signal_Name :=
                                         "set_scroll_adjustments";

### Line_Wrap_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Line_Wrap_Property   : constant Glib.Properties.Property_Boolean;

### Vadjustment_Property

- Goto declaration in source

(Glib.Properties.Property_Object)

    Vadjustment_Property : constant Glib.Properties.Property_Object;

### Word_Wrap_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Word_Wrap_Property   : constant Glib.Properties.Property_Boolean;

# Subprograms & Entries

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Text: out Gtk_Text;Hadj: in Adjustment.Gtk_Adjustment := null;Vadj: in Adjustment.Gtk_Adjustment := null);

Create a new text widget with the given adjustments. If either or both scrollbars is not provided, the text widget will create its own. You need to insert the Gtk_Text in a Gtk_Scrolled_Window to make the scrollbars visible. Not also that this widget does not currently support horizontal scrollbars.

### Initialize

- Goto spec in source

    procedure Initialize (Text: access Gtk_Text_Record'Class;Hadj: in Adjustment.Gtk_Adjustment := null;Vadj: in Adjustment.Gtk_Adjustment := null);

Internal initialization function. See the section "Creating your own widgets" in the documentation.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Text.

### Get_Text_Area

- Goto spec in source

    function Get_Text_Area (Text: access Gtk_Text_Record) return Gdk.Window.Gdk_Window;

Return the specific window into which the text is displayed. Note that a Gtk_Text is in fact a complex widget, which includes borders on the sides. Thus, whenever you want to convert the mouse coordinates to a position in the text, you should use the Gdk.Window.Get_Pointer function, passing it this text area as the origin window, rather than directly Get_Window (Text). Note that null will be returned while Text hasn't been realized.

### Backward_Delete

- Goto spec in source

    function Backward_Delete (Text: access Gtk_Text_Record;Nchars: in Guint) return Boolean;

Backward delete Nchars characters from the current cursor position. There must be at least Nchars characters to delete before the pointer, or the operation will not be performed. Return True if the operation was successful, False otherwise.

### Forward_Delete

- Goto spec in source

    function Forward_Delete (Text: access Gtk_Text_Record;Nchars: in Guint) return Boolean;

Forward delete Nchars characters from the current point position. There must be at least Nchars characters to delete after the pointer, or the operation will not be performed. Return True if the operation was successful, False otherwise.

### Freeze

- Goto spec in source

    procedure Freeze (Text: access Gtk_Text_Record);

Freeze the Gtk_Text widget. In other words, stop any redrawing of the widget until the Thaw operation is called. This operation is useful when a large number of changes need to be made within the widget. Freezing it during the updates will avoid some flicker seen by the user. Note also that an internal counter is incremented. The updates will be performed only when the same numbers of calls to Thaw has been performed. Note that you can not call Set_Position while the widget is frozen. This will create a Storage_Error otherwise.

### Thaw

- Goto spec in source

    procedure Thaw (Text: access Gtk_Text_Record);

Cancel the previous call to Freeze. Allow the widget to be redrawn again, when Thaw has been called as many times as Freeze.

### Get_Gap_Position

- Goto spec in source

    function Get_Gap_Position (Text: access Gtk_Text_Record) return Guint;

<doc_ignore>

### Get_Gap_Size

- Goto spec in source

    function Get_Gap_Size (Text: access Gtk_Text_Record) return Guint;

### Get_Text_End

- Goto spec in source

    function Get_Text_End (Text: access Gtk_Text_Record) return Guint;

Those 2 functions should probably be deleted. </doc_ignore>

### Get_Hadj

- Goto spec in source

    function Get_Hadj (Text: access Gtk_Text_Record) return Gtk.Adjustment.Gtk_Adjustment;

Return the horizontal scrollbar associated with Text.

### Get_Vadj

- Goto spec in source

    function Get_Vadj (Text: access Gtk_Text_Record) return Gtk.Adjustment.Gtk_Adjustment;

Return the vertical scrollbar associated to the given text widget.

### Get_Length

- Goto spec in source

    function Get_Length (Text: access Gtk_Text_Record) return Guint;

Return the total length of the text contained within the text widget.

### Get_Point

- Goto spec in source

    function Get_Point (Text: access Gtk_Text_Record) return Guint;

Get the current position of the insertion point (cursor). Return the number of characters from the upper left corner of the widget.

### Set_Point

- Goto spec in source

    procedure Set_Point (Text: access Gtk_Text_Record;Index: in Guint);

Set the insertion point position. This does not modify the position of the visible cursor (see Gtk.Editable.Set_Position instead).

### Get_Text

- Goto spec in source

    function Get_Text (Text: access Gtk_Text_Record) return UTF8_String;

<doc_ignore>

### Insert

- Goto spec in source

    procedure Insert (Text: access Gtk_Text_Record;Font: in Gdk.Font.Gdk_Font := Gdk.Font.Null_Font;Fore: in Gdk.Color.Gdk_Color := Gdk.Color.Null_Color;Back: in Gdk.Color.Gdk_Color := Gdk.Color.Null_Color;Chars: in UTF8_String := "";Length: in Gint := -1);

Insert the given string (Chars) inside the text of the text widget. Use the specified Font, foreground (Fore) and background (Back) colors. Only the first "Length" characters are inserted, unless Length is set to -1, in which case the complete string is inserted. Note that the colors must be allocated first, and the font loaded. If the default parameters are passed for font and colors, the text widget will use the ones defined in the style for Text (see Gtk.Style for more information about styles).

### Set_Adjustments

- Goto spec in source

    procedure Set_Adjustments (Text: access Gtk_Text_Record;Hadj: Gtk.Adjustment.Gtk_Adjustment;Vadj: Gtk.Adjustment.Gtk_Adjustment);

Set the horizontal and vertical adjustments associated with Text.

### Set_Editable

- Goto spec in source

    procedure Set_Editable (Text: access Gtk_Text_Record;Editable: in Boolean := True);

Toggle the editable state of the given text widget. This determines whether the user can edit the text or not. Note that the programmer can still perform any update.

### Set_Line_Wrap

- Goto spec in source

    procedure Set_Line_Wrap (Text: access Gtk_Text_Record;Line_Wrap: in Boolean := True);

Set the Line_Wrap state of the given text widget. If set to True, the line is broken when it reaches the extent of the widget viewing area and the rest is displayed on the next line. If set to false, the line continues regardless of the size of current viewing area.

### Set_Word_Wrap

- Goto spec in source

    procedure Set_Word_Wrap (Text: access Gtk_Text_Record;Word_Wrap: in Boolean := True);

Set the Word_Wrap state of the given text widget. If set to True, words are wrapped down to the next line if they can't be completed on the current line.