Index

Package: Text

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

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

Ancestors:

Primitive operations:

Backward_Delete
Forward_Delete
Get_Gap_Position
Get_Gap_Size
Get_Text_Area
Get_Text_End
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Gtk.Old_Editable.Changed (Inherited)
Gtk.Old_Editable.Claim_Selection (Inherited)
Gtk.Old_Editable.Copy_Clipboard (Inherited)
Gtk.Old_Editable.Cut_Clipboard (Inherited)
Gtk.Old_Editable.Delete_Selection (Inherited)
Gtk.Old_Editable.Delete_Text (Inherited)
Gtk.Old_Editable.Get_Chars (Inherited)
Gtk.Old_Editable.Get_Clipboard_Text (Inherited)
Gtk.Old_Editable.Get_Editable (Inherited)
Gtk.Old_Editable.Get_Has_Selection (Inherited)
Gtk.Old_Editable.Get_Position (Inherited)
Gtk.Old_Editable.Get_Selection_End_Pos (Inherited)
Gtk.Old_Editable.Get_Selection_Start_Pos (Inherited)
Gtk.Old_Editable.Insert_Text (Inherited)
Gtk.Old_Editable.Paste_Clipboard (Inherited)
Gtk.Old_Editable.Select_Region (Inherited)
Gtk.Old_Editable.Set_Editable (Inherited)
Gtk.Old_Editable.Set_Position (Inherited)
Gtk.Widget.Activate (Inherited)
Gtk.Widget.Add_Accelerator (Inherited)
Gtk.Widget.Add_Events (Inherited)
Gtk.Widget.Add_Mnemonic_Label (Inherited)
Gtk.Widget.Can_Activate_Accel (Inherited)
Gtk.Widget.Child_Notify (Inherited)
Gtk.Widget.Class_Path (Inherited)
Gtk.Widget.Class_Path_Reversed (Inherited)
Gtk.Widget.Create_Pango_Context (Inherited)
Gtk.Widget.Create_Pango_Layout (Inherited)
Gtk.Widget.Destroy (Inherited)
Gtk.Widget.Draw (Inherited)
Gtk.Widget.Ensure_Style (Inherited)
Gtk.Widget.Error_Bell (Inherited)
Gtk.Widget.Flag_Is_Set (Inherited)
Gtk.Widget.Flags (Inherited)
Gtk.Widget.Freeze_Child_Notify (Inherited)
Gtk.Widget.Get_Allocation_Height (Inherited)
Gtk.Widget.Get_Allocation_Width (Inherited)
Gtk.Widget.Get_Allocation_X (Inherited)
Gtk.Widget.Get_Allocation_Y (Inherited)
Gtk.Widget.Get_Ancestor (Inherited)
Gtk.Widget.Get_Child_Requisition (Inherited)
Gtk.Widget.Get_Child_Visible (Inherited)
Gtk.Widget.Get_Colormap (Inherited)
Gtk.Widget.Get_Composite_Name (Inherited)
Gtk.Widget.Get_Direction (Inherited)
Gtk.Widget.Get_Events (Inherited)
Gtk.Widget.Get_Extension_Events (Inherited)
Gtk.Widget.Get_Has_Tooltip (Inherited)
Gtk.Widget.Get_Name (Inherited)
Gtk.Widget.Get_No_Show_All (Inherited)
Gtk.Widget.Get_Pango_Context (Inherited)
Gtk.Widget.Get_Parent (Inherited)
Gtk.Widget.Get_Parent_Window (Inherited)
Gtk.Widget.Get_Pointer (Inherited)
Gtk.Widget.Get_Root_Window (Inherited)
Gtk.Widget.Get_Size_Request (Inherited)
Gtk.Widget.Get_Snapshot (Inherited)
Gtk.Widget.Get_State (Inherited)
Gtk.Widget.Get_Style (Inherited)
Gtk.Widget.Get_Tooltip_Markup (Inherited)
Gtk.Widget.Get_Tooltip_Text (Inherited)
Gtk.Widget.Get_Tooltip_Window (Inherited)
Gtk.Widget.Get_Toplevel (Inherited)
Gtk.Widget.Get_Visual (Inherited)
Gtk.Widget.Get_Window (Inherited)
Gtk.Widget.Grab_Default (Inherited)
Gtk.Widget.Grab_Focus (Inherited)
Gtk.Widget.Has_Screen (Inherited)
Gtk.Widget.Hide (Inherited)
Gtk.Widget.Hide_All (Inherited)
Gtk.Widget.Input_Shape_Combine_Mask (Inherited)
Gtk.Widget.Intersect (Inherited)
Gtk.Widget.Is_Ancestor (Inherited)
Gtk.Widget.Is_Composited (Inherited)
Gtk.Widget.Is_Focus (Inherited)
Gtk.Widget.Keynav_Failed (Inherited)
Gtk.Widget.List_Mnemonic_Labels (Inherited)
Gtk.Widget.Map (Inherited)
Gtk.Widget.Mnemonic_Activate (Inherited)
Gtk.Widget.Modify_Base (Inherited)
Gtk.Widget.Modify_Bg (Inherited)
Gtk.Widget.Modify_Cursor (Inherited)
Gtk.Widget.Modify_Fg (Inherited)
Gtk.Widget.Modify_Font (Inherited)
Gtk.Widget.Modify_Text (Inherited)
Gtk.Widget.Path (Inherited)
Gtk.Widget.Path_Reversed (Inherited)
Gtk.Widget.Queue_Clear (Inherited)
Gtk.Widget.Queue_Clear_Area (Inherited)
Gtk.Widget.Queue_Draw (Inherited)
Gtk.Widget.Queue_Draw_Area (Inherited)
Gtk.Widget.Queue_Resize (Inherited)
Gtk.Widget.Queue_Resize_No_Redraw (Inherited)
Gtk.Widget.Realize (Inherited)
Gtk.Widget.Region_Intersect (Inherited)
Gtk.Widget.Remove_Accelerator (Inherited)
Gtk.Widget.Remove_Mnemonic_Label (Inherited)
Gtk.Widget.Render_Icon (Inherited)
Gtk.Widget.Reparent (Inherited)
Gtk.Widget.Reset_Rc_Styles (Inherited)
Gtk.Widget.Reset_Shapes (Inherited)
Gtk.Widget.Restore_Default_Style (Inherited)
Gtk.Widget.Send_Expose (Inherited)
Gtk.Widget.Set_Accel_Path (Inherited)
Gtk.Widget.Set_App_Paintable (Inherited)
Gtk.Widget.Set_Child_Visible (Inherited)
Gtk.Widget.Set_Colormap (Inherited)
Gtk.Widget.Set_Composite_Name (Inherited)
Gtk.Widget.Set_Direction (Inherited)
Gtk.Widget.Set_Double_Buffered (Inherited)
Gtk.Widget.Set_Events (Inherited)
Gtk.Widget.Set_Extension_Events (Inherited)
Gtk.Widget.Set_Flags (Inherited)
Gtk.Widget.Set_Has_Tooltip (Inherited)
Gtk.Widget.Set_Name (Inherited)
Gtk.Widget.Set_No_Show_All (Inherited)
Gtk.Widget.Set_Parent (Inherited)
Gtk.Widget.Set_Parent_Window (Inherited)
Gtk.Widget.Set_Redraw_On_Allocate (Inherited)
Gtk.Widget.Set_Scroll_Adjustments (Inherited)
Gtk.Widget.Set_Sensitive (Inherited)
Gtk.Widget.Set_Size_Request (Inherited)
Gtk.Widget.Set_State (Inherited)
Gtk.Widget.Set_Style (Inherited)
Gtk.Widget.Set_Tooltip_Markup (Inherited)
Gtk.Widget.Set_Tooltip_Text (Inherited)
Gtk.Widget.Set_Tooltip_Window (Inherited)
Gtk.Widget.Set_UPosition (Inherited)
Gtk.Widget.Set_USize (Inherited)
Gtk.Widget.Set_Window (Inherited)
Gtk.Widget.Shape_Combine_Mask (Inherited)
Gtk.Widget.Show (Inherited)
Gtk.Widget.Show_All (Inherited)
Gtk.Widget.Show_Now (Inherited)
Gtk.Widget.Size_Allocate (Inherited)
Gtk.Widget.Size_Request (Inherited)
Gtk.Widget.Style_Get_Property (Inherited)
Gtk.Widget.Thaw_Child_Notify (Inherited)
Gtk.Widget.Trigger_Tooltip_Query (Inherited)
Gtk.Widget.Unmap (Inherited)
Gtk.Widget.Unrealize (Inherited)
Gtk.Widget.Unset_Flags (Inherited)
Set_Adjustments
Set_Editable
Set_Line_Wrap
Set_Word_Wrap

Types

Gtk_Text

type Gtk_Text is access all Gtk_Text_Record'Class;

Constants & Global variables

Signal_Set_Scroll_Adjustments (Glib.Signal_Name)

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

Vadjustment_Property (Glib.Properties.Property_Object)

Vadjustment_Property : constant Glib.Properties.Property_Object;

Subprograms & Entries

Gtk_New

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

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

function Get_Type return Gtk.Gtk_Type;
Return the internal value associated with a Gtk_Text.

Get_Text_Area

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

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

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

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

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

function Get_Gap_Position 
(Text: access Gtk_Text_Record) return Guint;
<doc_ignore>

Get_Gap_Size

function Get_Gap_Size 
(Text: access Gtk_Text_Record) return Guint;

Get_Text_End

function Get_Text_End 
(Text: access Gtk_Text_Record) return Guint;
Those 2 functions should probably be deleted. </doc_ignore>

Get_Hadj

function Get_Hadj 
(Text: access Gtk_Text_Record) return Gtk.Adjustment.Gtk_Adjustment;
Return the horizontal scrollbar associated with Text.

Get_Vadj

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

function Get_Length 
(Text: access Gtk_Text_Record) return Guint;
Return the total length of the text contained within the text widget.

Get_Point

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

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

function Get_Text 
(Text: access Gtk_Text_Record) return UTF8_String;
<doc_ignore>

Insert

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

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

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

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

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.