Object Hierarchy:

Object hierarchy for ValidatedEntry


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.


  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.


  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



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 interface Atk.Implementor
All known members inherited from interface Gtk.CellEditable