Enumeration

Gtk.InputPurpose

Declaration

enum Gtk.InputPurpose

Description [src]

Describes primary purpose of the input widget.

This information is useful for on-screen keyboards and similar input methods to decide which keys should be presented to the user.

Note that the purpose is not meant to impose a totally strict rule about allowed characters, and does not replace input validation. It is fine for an on-screen keyboard to let the user override the character set restriction that is expressed by the purpose. The application is expected to validate the entry contents, even if it specified a purpose.

The difference between GTK_INPUT_PURPOSE_DIGITS and GTK_INPUT_PURPOSE_NUMBER is that the former accepts only digits while the latter also some punctuation (like commas or points, plus, minus) and “e” or “E” as in 3.14E+000.

This enumeration may be extended in the future; input methods should interpret unknown values as “free form”.

Members

Name Nickname Value Description
GTK_INPUT_PURPOSE_FREE_FORM "free-form" 0

Allow any character

GTK_INPUT_PURPOSE_ALPHA "alpha" 1

Allow only alphabetic characters

GTK_INPUT_PURPOSE_DIGITS "digits" 2

Allow only digits

GTK_INPUT_PURPOSE_NUMBER "number" 3

Edited field expects numbers

GTK_INPUT_PURPOSE_PHONE "phone" 4

Edited field expects phone number

GTK_INPUT_PURPOSE_URL "url" 5

Edited field expects URL

GTK_INPUT_PURPOSE_EMAIL "email" 6

Edited field expects email address

GTK_INPUT_PURPOSE_NAME "name" 7

Edited field expects the name of a person

GTK_INPUT_PURPOSE_PASSWORD "password" 8

Like GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden

GTK_INPUT_PURPOSE_PIN "pin" 9

Like GTK_INPUT_PURPOSE_DIGITS, but characters are hidden

GTK_INPUT_PURPOSE_TERMINAL "terminal" 10

Allow any character, in addition to control codes