A Gtk_Entry is a single line text editing widget. The text is automatically scrolled if it is longer than can be displayed on the screen, so that the cursor position is visible at all times.
See Gtk_Text_View for a multiple-line text editing widget.
Widget Hierarchy |
---|
GObject (see section Package Glib.Object) Gtk_Object (see section Package Gtk.Object) \___ Gtk_Widget (see section Package Gtk.Widget) \___ Gtk_Editable (see section Package Gtk.Editable) \___ Gtk_Entry (see section Package Gtk.GEntry) |
Signals |
---|
Subprograms |
---|
procedure Gtk_New (Widget : out Gtk_Entry); | ||
Create a new entry with no maximum length for the text
| ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Entry.
| ||
procedure Set_Visibility (The_Entry : access Gtk_Entry_Record; Visible : Boolean); | ||
Set the visibility of the characters in the entry. | ||
function Get_Visibility (The_Entry : access Gtk_Entry_Record) return Boolean; | ||
Return the visibility of the characters in the entry.
| ||
procedure Set_Invisible_Char (The_Entry : access Gtk_Entry_Record; Char : Gunichar); | ||
Set the character to use in place of the actual text when | ||
function Get_Invisible_Char (The_Entry : access Gtk_Entry_Record) return Gunichar; | ||
Retrieve the character displayed in place of the real characters | ||
procedure Set_Has_Frame (The_Entry : access Gtk_Entry_Record; Setting : Boolean := True); | ||
Set whether the entry has a beveled frame around it.
| ||
function Get_Has_Frame (The_Entry : access Gtk_Entry_Record) return Boolean; | ||
Return whether the entry has a beveled frame.
| ||
procedure Set_Max_Length (The_Entry : access Gtk_Entry_Record; Max : Gint); | ||
Set the maximum length for the text. | ||
function Get_Max_Length (The_Entry : access Gtk_Entry_Record) return Gint; | ||
Return the maximum length for the text.
| ||
procedure Set_Activates_Default (The_Entry : access Gtk_Entry_Record; Setting : Boolean); | ||
If Setting is True, pressing Enter in the Entry will activate the
(For experts: if Setting is True, the entry calls
Gtk.Window.Activate_Default on the window containing the entry, in
the default handler for the "activate" signal.)
| ||
function Get_Activates_Default (The_Entry : access Gtk_Entry_Record) return Boolean; | ||
Return whether the entry will activate the default widget.
| ||
procedure Set_Width_Chars (The_Entry : access Gtk_Entry_Record'Class; Width : Gint); | ||
Number of characters to leave space for in the entry, on the screen. | ||
function Get_Width_Chars (The_Entry : access Gtk_Entry_Record'Class) return Gint; | ||
Return number of characters to leave space for in the entry.
| ||
procedure Set_Text (The_Entry : access Gtk_Entry_Record; Text : UTF8_String); | ||
Modify the text in the entry. | ||
function Get_Text (The_Entry : access Gtk_Entry_Record) return UTF8_String; | ||
Return the current text written in the entry.
| ||
procedure Get_Layout_Offsets (The_Entry : access Gtk_Entry_Record; X : out Gint; Y : out Gint); | ||
Obtain the position of the Pango_Layout used to render text Also useful to convert mouse events into coordinates inside the Pango_Layout, e.g. to take some action if some part of the entry text is clicked.
Note that as the user scrolls around in the entry the offsets will
change; you'll need to connect to the "notify::scroll_offset"
signal to track this. Remember when using the Pango_Layout
functions you need to convert to and from pixels using
Pango_Pixels or Pango_Scale.
| ||
function Get_Layout (The_Entry : access Gtk_Entry_Record) return Pango.Layout.Pango_Layout; | ||
Return the widget that manages all the layout of text (left-to-right,
The layout is useful to e.g. convert text positions to pixel positions,
in combination with Get_Layout_Offsets. The returned layout is owned by
the entry so need not be freed by the caller.
|