ValidatedEntry


Object Hierarchy:

Granite.ValidatedEntry Granite.ValidatedEntry Granite.ValidatedEntry Gtk.Entry Gtk.Entry Gtk.Entry->Granite.ValidatedEntry Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Entry GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.Entry Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Entry Gtk.Buildable->Gtk.Widget Gtk.CellEditable Gtk.CellEditable Gtk.CellEditable->Gtk.Entry Gtk.Editable Gtk.Editable Gtk.Editable->Gtk.Entry

Description:


public class ValidatedEntry : Entry

ValidatedEntry is a Gtk.Entry subclass that is meant to be used in forms where input must be validated before the form can be submitted. It provides feedback to users about the state of input validation and keeps track of its own validation state. By default, input is considered invalid.

Example

	var validated_entry = new Granite.ValidatedEntry ();
username_entry.changed.connect (() => {
username_entry.is_valid = username_entry.text == "valid input";
});

If the ValidatedEntry.from_regex () constructor is used then the entry automatically sets its validity status. A valid regex must be passed to this constructor.

Example

	Regex? regex = null;
ValidatedEntry only_lower_case_letters_entry;
try {
regex = new Regex ("^[a-z]*$");
only_lower_case_letters_entry = new ValidatedEntry.from_regex (regex);
} catch (Error e) {
critical (e.message);
// Provide a fallback entry
}

Namespace: Granite
Package: granite

Content:

Properties:

Creation methods:

Inherited Members:

All known members inherited from class Gtk.Entry
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.CellEditable
All known members inherited from interface Gtk.Editable



2022 vala-language.org