package Implements_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Entry_Completion_Record, Gtk_Entry_Completion);
package Implements_CellLayout is new Glib.Types.Implements (Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Entry_Completion_Record, Gtk_Entry_Completion);
type Gtk_Entry_Completion_Record is new GObject_Record with null record;
type Gtk_Entry_Completion is access all Gtk_Entry_Completion_Record'Class;
type C_Gtk_Entry_Completion_Match_Func is access function (Completion : System.Address; Key : Interfaces.C.Strings.chars_ptr; Iter : Gtk.Tree_Model.Gtk_Tree_Iter; Data : System.Address) return Boolean;
Inline_Completion_Property : constant Glib.Properties.Property_Boolean;
Inline_Selection_Property : constant Glib.Properties.Property_Boolean;
Minimum_Key_Length_Property : constant Glib.Properties.Property_Int;
Model_Property : constant Glib.Properties.Property_Object;
Popup_Completion_Property : constant Glib.Properties.Property_Boolean;
Popup_Set_Width_Property : constant Glib.Properties.Property_Boolean;
Popup_Single_Match_Property : constant Glib.Properties.Property_Boolean;
Text_Column_Property : constant Glib.Properties.Property_Int;
Signal_Action_Activated : constant Glib.Signal_Name := "action-activated";
Signal_Cursor_On_Match : constant Glib.Signal_Name := "cursor-on-match";
Signal_Insert_Prefix : constant Glib.Signal_Name := "insert-prefix";
Signal_Match_Selected : constant Glib.Signal_Name := "match-selected";
procedure Gtk_New
( | Completion | : out Gtk_Entry_Completion); |
procedure Initialize
( | Completion | : access Gtk_Entry_Completion_Record'Class); |
function Get_Type return Glib.GType;
procedure Complete
( | Completion | : access Gtk_Entry_Completion_Record); |
procedure Delete_Action
( | Completion | : access Gtk_Entry_Completion_Record; |
Index | : Gint); |
function Get_Completion_Prefix
( | Completion | : access Gtk_Entry_Completion_Record) return UTF8_String; |
function Get_Entry
( | Completion | : access Gtk_Entry_Completion_Record) return Gtk.Widget.Gtk_Widget; |
function Get_Inline_Completion
( | Completion | : access Gtk_Entry_Completion_Record) return Boolean; |
procedure Set_Inline_Completion
( | Completion | : access Gtk_Entry_Completion_Record; |
Inline_Completion | : Boolean); |
function Get_Inline_Selection
( | Completion | : access Gtk_Entry_Completion_Record) return Boolean; |
procedure Set_Inline_Selection
( | Completion | : access Gtk_Entry_Completion_Record; |
Inline_Selection | : Boolean); |
function Get_Minimum_Key_Length
( | Completion | : access Gtk_Entry_Completion_Record) return Gint; |
procedure Set_Minimum_Key_Length
( | Completion | : access Gtk_Entry_Completion_Record; |
Length | : Gint); |
function Get_Model
( | Completion | : access Gtk_Entry_Completion_Record) return Gtk.Tree_Model.Gtk_Tree_Model; |
procedure Set_Model
( | Completion | : access Gtk_Entry_Completion_Record; |
Model | : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class); |
function Get_Popup_Completion
( | Completion | : access Gtk_Entry_Completion_Record) return Boolean; |
procedure Set_Popup_Completion
( | Completion | : access Gtk_Entry_Completion_Record; |
Popup_Completion | : Boolean); |
function Get_Popup_Set_Width
( | Completion | : access Gtk_Entry_Completion_Record) return Boolean; |
procedure Set_Popup_Set_Width
( | Completion | : access Gtk_Entry_Completion_Record; |
Popup_Set_Width | : Boolean); |
function Get_Popup_Single_Match
( | Completion | : access Gtk_Entry_Completion_Record) return Boolean; |
procedure Set_Popup_Single_Match
( | Completion | : access Gtk_Entry_Completion_Record; |
Popup_Single_Match | : Boolean); |
function Get_Text_Column
( | Completion | : access Gtk_Entry_Completion_Record) return Gint; |
procedure Set_Text_Column
( | Completion | : access Gtk_Entry_Completion_Record; |
Column | : Gint); |
procedure Insert_Action_Markup
( | Completion | : access Gtk_Entry_Completion_Record; |
Index | : Gint; | |
Markup | : UTF8_String); |
procedure Insert_Action_Text
( | Completion | : access Gtk_Entry_Completion_Record; |
Index | : Gint; | |
Text | : UTF8_String); |
procedure Insert_Prefix
( | Completion | : access Gtk_Entry_Completion_Record); |
procedure Set_Match_Func
( | Completion | : access Gtk_Entry_Completion_Record; |
Func | : C_Gtk_Entry_Completion_Match_Func; | |
Func_Data | : System.Address; | |
Func_Notify | : Glib.G_Destroy_Notify_Address); |
function "+"
( | Widget | : access Gtk_Entry_Completion_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Entry_Completion renames Implements_Buildable.To_Object; |
function "+"
( | Widget | : access Gtk_Entry_Completion_Record'Class) return Gtk.Cell_Layout.Gtk_Cell_Layout renames Implements_CellLayout.To_Interface; |
function "-"
( | Interf | : Gtk.Cell_Layout.Gtk_Cell_Layout) return Gtk_Entry_Completion renames Implements_CellLayout.To_Object; |
This widget provides completion functionality for Gtk.Gentry.Gtk_Entry. "Completion functionality" means that when the user modifies the text in the entry, GtkEntryCompletion checks which rows in the model match the current content of the entry, and displays a list of matches. By default, the matching is done by comparing the entry text case-insensitively against the text column of the model (see Set_Text_Column), but this can be overridden with a custom match function (see Set_Match_Func).
When the user selects a completion, the content of the entry is updated.
By default, the content of the entry is replaced by the text column of the model, but this can be overridden by connecting to the ::match-selected signal and updating the entry in the signal handler. Note that you should return TRUE from the signal handler to suppress the default behaviour.
To add completion functionality to an entry, use Gtk.Entry.Set_Completion.
In addition to regular completion matches, which will be inserted into the entry when they are selected, GtkEntryCompletion also allows to display "actions" in the popup window. Their appearance is similar to menuitems, to differentiate them clearly from completion strings. When an action is selected, the ::action-activated signal is emitted.